-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symlinking git hooks causing unexpected behaviour #627
Comments
I'm a bit confused. When I clone a git project, the files from |
@geoffharcourt no, But you're right, using |
I ran into the same (or similar) problem while working with Git LFS. I ended up deleting the Git hooks directory from my dotfiles (which were originally based on thoughtbot/dotfiles): croaky/laptop@1c96034 I had previously deleted the majority of what was in the Git hooks directory, which was ctags-related for Vim, because my jump-to-definition etc. is now handled by LSP tools such as |
Thank you for a great repo guys, it helps me really a lot to organise all the dotfiles stuff!
There is a potential implicit issue/risk covers in symlinking hooks.
Description:
Let's say you have such scenario:
git clone project-a
git clone project-b
cd project-a
composer install
// additionally installs f.e. post-commit hookThis will most probably break project-b by modifying the project hooks and additionally will modify template hooks in the root dotfiles folder.
In such a scenario composer changes
post-commit
hook in theproject-a
which following the links chain, leads to the changes inproject-b/.git/hooks/post-commit
as well as~/dotfiles/git_template/hooks/post-commit
, since post-commit inproject-a
is just a link to the initial file.It's quite common that some tool like composer may change hooks, which leads to such implicit scenario if hooks were symlinked.
Possible solution:
git_template/hooks
should be copied and not symlinkedThe text was updated successfully, but these errors were encountered: