Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不断更新我的本地 git 钩子。我有一个仓库来存放我的 .git 模板。这意味着我一直在运行 git init --template=../git-template 以使用我的钩子更改来更新 repos。
问题:每次我运行 git init --temp... 时,我都需要先删除 .git/hooks 中的钩子,这些钩子将被更新的钩子替换。这很烦人。我知道我可以编写脚本从我想要更新的 repo 中删除这些钩子,但是这个功能是否已经内置在 git 中?
这并不能完全回答您的问题,但我只是将所有 .git/hooks 文件夹符号链接到一个公共位置,以便我可以修改它;这可能会让你的生活更轻松