Some problems may appear remote repository GitHub in use

You can not complete hosting, hosting an error:

  The problem occurs because (Non-fast-forward) is that: git repository has been part of the code, so it does not allow you to directly cover up your code. So you have two ways to select:   

    1, strong push, namely the use of a strong alternative to cover the contents of your local git repository with the code ------ (my first time in this way is solved)

        git push -f

      However, this time appeared the following questions:

            

      By Settings-Email-Keep my email address private, to the scratched on it.

    2, first git fetch something to you and then merge the local and then push      

        $ git fetch

        $ Git go

        This command is equivalent to 2 == $ git pull

      However, this time appeared the following questions:

      

      [branch "master"] is the need to clear (.git / config) following contents
        [branch "master"]
           Remote = Origin

           merge = refs/heads/master      

      This tells git2 things:
        1, when you are in the master branch, the default remote is origin.

        2, when you use git pull, no remote and branch, so git will use the default remote (ie, origin) to merge all the changes in the master branch on the master branch
        if you do not, or will not, then edit the config file , the following command can be entered on the bush line:

          $ git config branch.master.remote origin

          $ git config branch.master.merge refs/heads/master


Original: https: //blog.csdn.net/chain2012/article/details/7476493

 

Guess you like

Origin www.cnblogs.com/jjb1997/p/11272808.html