git push error: failed to push some refs to 'ssh://git@ip:8850/Out/Afuyigou.

使用git在本地进行修改之后提交的时候碰到如下错误:
git push error: failed to push some refs to 'ssh://git@ip:8850/Out/Afuyigou._第1张图片

$ git push origin leen:leen
To ssh://git@IP:端口/Out/Afuyigou.git
 ! [rejected]        leen -> leen (non-fast-forward)
error: failed to push some refs to 'ssh://git@IP:端口/Out/Afuyigou.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

从网上查询得知是当前分支和远程分支不一致所致,解决方法如下:

   1.git fetch               #获取远程分支最新内容
   2.git merge origin/远程分支             #将远程分支上的内容合并到当前分支

git push error: failed to push some refs to 'ssh://git@ip:8850/Out/Afuyigou._第2张图片

再次push就OK了。如图:
git push error: failed to push some refs to 'ssh://git@ip:8850/Out/Afuyigou._第3张图片

Author:leedaning
本文地址:http://blog.csdn.net/leedaning/article/details/50668458

你可能感兴趣的:(版本控制)