1. 程式人生 > >用git push程式碼到遠端倉庫的時候出現錯誤

用git push程式碼到遠端倉庫的時候出現錯誤

開發十年,就只剩下這套架構體系了! >>>   

error:failed to push some refs to ...

Dealing with “non-fast-forward” errors

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

$ git push origin master 

To ../remote/ 

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

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

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

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

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

 

 

2. 先把git的東西fetch到你本地然後merge後再push

$ git fetch

$ git merge

這2句命令等價於

$ git pul