Cannot push to GitHub - keeps saying need merge

后端 未结 30 2741
天命终不由人
天命终不由人 2020-11-22 00:09

I\'m new to GitHub. Today I met some issue when I was trying to push my code to GitHub.

Pushing to git@github.com:519ebayproject/519ebayproject.git
To git@gi         


        
30条回答
  •  Happy的楠姐
    2020-11-22 00:54

    This can cause the remote repository to lose commits; use it with care.

    If you do not wish to merge the remote branch into your local branch (see differences with git diff), and want to do a force push, use the push command with -f

    git push -f origin 
    

    where origin is the name of your remote repo.

    Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. This flag disables the check. This can cause the remote repository to lose commits; use it with care.

提交回复
热议问题