Git push error pre-receive hook declined

前端 未结 14 1175
眼角桃花
眼角桃花 2020-11-28 03:06

I have run gitlabhq rails server on virtual machine, following 1-6 steps from this tutorial https://github.com/gitlabhq/gitlab-recipes/blob/master/install/centos/README.md a

14条回答
  •  孤城傲影
    2020-11-28 03:53

    Following resolved problem in my local machine:

    A. First, ensure that you are using the correct log on details to connect to Bitbucket Server (ie. a username/password/SSH key that belongs to you) 

    B. Then, ensure that the name/email address is correctly set in your local Git configuration: Set your local Git configuration for the account that you are trying to push under (the check asserts that you are the person who committed the files) * Note that this is case sensitive, both for name and email address * It is also space sensitive - some company accounts have extra spaces/characters in their name eg. "Contractor/ space space(LDN)".  You must include the same number of spaces in your configuration as on Bitbucket Server.  Check this in Notepad if stuck.

    C. If you were using the wrong account, simply switch your account credentials (username/password/SSH key) and try pushing again.

    D. Else, if your local configuration incorrect you will need to amend it

    For MAC

    open -a TextEdit.app ~/.gitconfig

    NOTE: You will have to fix up the old commits that you were trying to push.

    1. Amend your last commit:

      > git commit --amend --reset-author
      
        
      
      
    2. Try re-pushing your commits:

      > git push
      

提交回复
热议问题