我正在寻找一种优雅的方式来从特定提交中 checkout 文件,而不会导致 checkout Hook 触发。
例如,我不想要:
git checkout foo/bar/baz.txt
导致 checkout 后钩子(Hook)触发。
最佳答案
git show HEAD:foo/bar/baz.txt | sed -e 'some funky stuff to correct line endings' > foo/bar/baz.txt
关于git - 如何以绕过钩子(Hook)的方式编写 git 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13926470/