JGit pre-receive hook
When using JGit, push to a remote machine that is on the same server.
1), if the console has been set up with file://
or /path/to/git/remote
, the pre-take hook will not be executed.
2), if the console has been configured with ssh://
, the pre-take hook will be performed.
If you do the same push using the Git command line, the pre-take hook will always be executed.
I don't understand why this is happening.
source to share
JGit doesn't support all hooks; when you push through ssh:
, the git remote server implementation does git hook support. When you use JGit to move to a local repository, it just updates the local content of the repository. (I'm not even sure if pushing to a local repository with a native git
client will do pre-receive
, since it doesn't work git upload-pack
and therefore doesn't do a checkout.
source to share