How do I configure a remote to have a fixed receive pack?

189 views Asked by At

I have a git bare repository on my server which has a post-receive hook that essentially does

GIT_WORK_TREE=`/path/to/public_html` git checkout -f

Whenever I do a push from my local repo to this remote I get an error:

fatal: bad config value for 'receive.denycurrentbranch' in ./config
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists

I found a solution for this which works fine. However, I cannot expect to type out the --exec=/usr/local/cpanel/3rdparty/bin/git-receive-pack each time I make a push. I know one option would be to make an alias to the whole command but that doesn't work great either since when I shift to a different system I need to have this command as well.

How do I go about enforcing that the right receive pack is used? The issue seems to be that I'm using a shared hosting which uses cPanel. Is there anything I can specify on my bare repo to ensure I can normally do git push origin master rather than specifying the pack? Or something that can be done on client side and stored into the main repo also works--as long as when I clone back the repo on another system I can continue using it normally. Suggestions?

0

There are 0 answers