progit / progit2

Pro Git 2nd Edition
Other
5.69k stars 1.88k forks source link

advocate git config receive.updateServerInfo instead of enabling a post-update hook #1829

Open datamuc opened 1 year ago

datamuc commented 1 year ago

https://github.com/progit/progit2/blob/d9acee50e367e82a1dfddd88ca0e5e00c2cc95d5/book/04-git-server/sections/protocols.asc?plain=1#L87-L109

I think instead of installing that hook the code block should look like this:

$ cd /var/www/htdocs/
$ git clone --bare /path/to/git_project gitproject.git
$ cd gitproject.git
$ git config receive.updateServerInfo true

The advantage is, that one can also set this option globally with git config --global or even --system, which is nice because it not necessary anymore to handle that hook for each repo individually.