Git_上传到码云版本冲突
不能上传到码云上$ git push test masterTo gitee.com:yoyhm/git.git! [rejected]master -> master (non-fast-forward)error: failed to push some refs to 'git@gitee.com:yoyhm/git.git'hint: Updates were re
·
不能上传到码云上
$ git push test master
To gitee.com:yoyhm/git.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:yoyhm/git.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. 产生版本冲突,将远程的pull到本地
$ git pull origin master
## 如果出现以下问题
## ------------------------
$ git pull test master
From gitee.com:yoyhm/git
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
## ------------------------------
## 解决上面问题
## ------
$ git merge test/master --allow-unrelated-histories
## ------
## 2. 再次推送即可
$ git push -u test master
更多推荐
已为社区贡献1条内容
所有评论(0)