git操作之常见问题解决方案

一、版本不一致

  1. 错误信息:    

1 > git push -u origin master
2 To ******.git
3  ! [rejected]        master -> master (non-fast-forward)
4 error: failed to push some refs to '*******.git'
5 hint: Updates were rejected because the tip of your current branch is behind
6 hint: its remote counterpart. Integrate the remote changes (e.g.
7 hint: 'git pull ...') before pushing again.
8 hint: See the 'Note about fast-forwards' in 'git push --help' for details.

  2. 错误原因: 本地和远程两个版本不一致。

  3. 解决方案: git push -u origin -f

  4. 注: 加'-f'的意思是-强制推送本地的替换服务端, 所以三思后行。

未完待续...

posted @ 2015-11-07 09:42  BuiltyMonkey  阅读(277)  评论(0编辑  收藏  举报