Domanda

If I have a local repository pulled from a remote one, and I add git hooks to my local repository before I push it back to the remote one, do the hooks go to the remote repo with the code?

È stato utile?

Soluzione

Nope. Nothing that you add directly under the .git directory will be sent from clone to clone, including hooks. It's a little inconvenient sometimes, but it also means that you can easily have different hooks in different clones, so it's a tradeoff.

One strategy is to put your hook scripts in a directory that is tracked by git, and write a script that symlinks them in to .git, so developers can easily wire them up in a fresh clone.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top