-
Notifications
You must be signed in to change notification settings - Fork 5
Listener
#!/bin/sh
# (replace "find ." with "find ./<path>" below, to work with only specific paths)
# (these lines are really all one line, on multiple lines for clarity)
# ...find symlinks which do not dereference to directories...
find . -type l -exec test '!' -d {} ';' -print -exec sh -c \
# ...remove the symlink blob, and add the content diff, to the index/cache
'git rm --cached "$1"; diff -au /dev/null "$1" | git apply --cached -p1 -' \
# ...and call out to "sh".
"process_links_to_nondir" {} ';'
# the end
Tehnik ini sering sekali digunakan dalam pembuatan plugin,component dalam suatu aplikasi baik cms,ecommerce,intranet aplikasi.
Secara default direktori hooks adalah $ GIT_DIR / hooks, tetapi itu dapat diubah melalui variabel konfigurasi core.hooksPath (lihat git-config (1)).
Sebelum Git memanggil sebuah hook, ia mengubah direktori kerjanya menjadi $ GIT_DIR dalam repositori kosong atau root dari pohon yang berfungsi dalam repositori non-telanjang.
Pengecualian adalah kait yang dipicu selama push (pra-terima, perbarui, pasca-terima, pasca-pembaruan, push-to-checkout) yang selalu dijalankan dalam $ GIT_DIR.
Hooks bisa mendapatkan argumen mereka melalui lingkungan, argumen command-line, dan stdin. Lihat dokumentasi untuk setiap kait di bawah ini untuk detailnya.
git init dapat menyalin kait ke repositori baru, tergantung pada konfigurasinya. Lihat bagian "TEMPLATE DIRECTORY" di git-init (1) untuk detailnya. Ketika sisa dokumen ini mengacu pada "kait default", itu berbicara tentang templat default yang dikirimkan bersama Git.
This documentation is mapped under Mapping and licensed under Apache License, Version 2.0.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2018-2020 Chetabahana Project