用git push代码到远程仓库的时候出现错误

error:failed to push some refs to ...git

Dealing with “non-fast-forward” errorsfetch

From time to time you may encounter this error while pushing:this

$ git push origin master spa

To ../remote/ rem

 ! [rejected]        master -> master (non-fast forward) it

error: failed to push some refs to '../remote/' io

To prevent you from losing history, non-fast-forward updates were rejectedevent

Merge the remote changes before pushing again.  See the 'non-fast forward'ast

section of 'git push --help' for details.date

 

 

2. 先把git的东西fetch到你本地而后merge后再push

$ git fetch

$ git merge

这2句命令等价于

$ git pull 

相关文章
相关标签/搜索