git push报错Updates were rejected because the tip of your current branch is behind

原创
2018/11/13 09:34
阅读数 3W

git push报错Updates were rejected because the tip of your current branch is behind

DannideMacBook-Pro:connect-cas2-client danni$ git push origin master
To https://gitee.com/danni3/connect-cas2-client.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/danni3/connect-cas2-client.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.

解决: git pull origin master

DannideMacBook-Pro:connect-cas2-client danni$ git pull origin master
From https://gitee.com/danni3/connect-cas2-client
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

解决: git pull origin master --allow-unrelated-histories

参考: https://www.cnblogs.com/code-changeworld/p/4779145.html https://www.centos.bz/2018/03/git-出现-fatal-refusing-to-merge-unrelated-histories-错误/

展开阅读全文
Git
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部