fatal: bad config value for 'receive.denycurrentbranch' in ./config

眉间皱痕 提交于 2019-12-06 10:24:05

The problem you're seeing is that you've set an invalid configuration value for the receive.denycurrentbranch option. It looks like from your console window that you have a version of Git that doesn't understand the refuse value (or you typed something like a non-breaking space in the value).

You should know that this value only applies to the server side. Setting it on the client side doesn't have any effect whatever. You should remove it from your config by editing the config (or .git/config, as appropriate) file and deleting the appropriate option, which should make pushes work again.

receive.denycurrentbranch to ignore will not solve problem it will create more problems later i suggest you to follow below steps

This will solve your problem for sure as i wasted my 5 hour in search for the same issue -

  1. First check the GIT VERSION on remote using ssh using command git --version In my case it was 2.19.1 which is this root cause for this problem.

  2. I suggest to create a new repo on cPanel before staring the below process, once you create new repo check following....

  3. Now make sure on remote config denyCurrentBranch = updateInstead below is my remote config screenshot, you can check remote config using command git config --edit when you inside remote repo directory My Live git config screenshot

  4. Now clone the cpanel repo on your local, and check your local git config file and make sure it has the tag [remote "origin"], if you can't find it use this command on your local git remote add origin ssh://username@website/home/username/reponame

  5. Now simply add any test file and commit the changes and push using below command and your remote repo will get updated 100% git push origin master -u --exec=/usr/local/cpanel/3rdparty/bin/git-receive-pack

Regards!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!