解决git版本冲突

来源:互联网 发布:开机还原软件大全 编辑:程序博客网 时间:2024/05/22 02:43

场景:

$ 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 rejected because the tip of your current branch is behindhint: 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 masterFrom gitee.com:yoyhm/git * branch            master     -> FETCH_HEADfatal: refusing to merge unrelated histories## ------------------------------## 解决上面问题## ------$ git merge test/master --allow-unrelated-histories## ------## 2. 再次推送即可$ git push -u test master
原创粉丝点击