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

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

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 mastergit

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-historiescentos

参考: http://www.javashuo.com/article/p-tqpikvtn-ed.html https://www.centos.bz/2018/03/git-出现-fatal-refusing-to-merge-unrelated-histories-错误/ide

相关文章
相关标签/搜索