Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JGit pre-receive hook

Tags:

git

jgit

When using JGit do a push to remote which is on the same server.

1) if the remote was configured with file:// or /path/to/git/remote, the pre-receive hook won't be executed.

2) if the remote was configured with ssh://, the pre-receive hook will be executed.

If doing the same push using the Git command line, pre-receive hook will always be executed.

I don't understand why this is happening.

like image 222
foolhunger Avatar asked Nov 10 '22 09:11

foolhunger


1 Answers

JGit doesn't support all hooks; when you push via ssh: the remote server's git implementation is performing the git hook support. When you use JGit to push to a local repository it's just updating the local contents of the repository. (I'm not even sure if pushing to a local repository with a native git client will execute a pre-receive since it's not running git upload-pack and therefore not doing a receive.

like image 162
AlBlue Avatar answered Dec 05 '22 21:12

AlBlue