git : refusing to merge unrelated histories
2017-10-26 15:35
531 查看
用 cocoaPods 创建了一个demo 程序, 在向 github 上传的时候, push 报错
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘https://github.com/name/XXXX.git’
google 下,解决办法是:
出现问题:
merge: origin - not something we can merge
或者用:
出现错误:
fatal: Couldn’t find remote ref branch
换一种方式, git pull 一下, 报错:
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
还是有问题, 此时是因为: 他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码.
然后我们在执行:
大功告成…
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘https://github.com/name/XXXX.git’
google 下,解决办法是:
$ git fetch origin $ git merge origin branch
出现问题:
merge: origin - not something we can merge
或者用:
$ git pull origin branch
出现错误:
fatal: Couldn’t find remote ref branch
换一种方式, git pull 一下, 报错:
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
还是有问题, 此时是因为: 他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码.
$ git pull origin master --allow-unrelated-histories
然后我们在执行:
$ git add . $ git commit -m "xxx" $ git push origin master
大功告成…
相关文章推荐
- fatal: refusing to merge unrelated histories(git)
- git无法pull仓库,提示错误:refusing to merge unrelated histories
- Git Pull Failed: fatal: refusing to merge unrelated histories
- git 报这个错 fatal: refusing to merge unrelated histories
- 远程创建新项目后想把本地项目推送上去 git fatal: refusing to merge unrelated histories
- GIT 错误 fatal: refusing to merge unrelated histories
- git常见问题之git pull origin master时fatal: refusing to merge unrelated histories
- git pull出现“fatal: refusing to merge unrelated histories“的解决方法
- git pull fatal: refusing to merge unrelated histories
- git pull 提示:fatal: refusing to merge unrelated histories
- [GITgit pull 失败 ,提示:fatal: refusing to merge unrelated histories
- github 上传以及git push代码遇到:refusing to merge unrelated histories或者non-fast-forward
- git pull 失败 ,提示:fatal: refusing to merge unrelated histories
- git refusing to merge unrelated histories
- Git pull失败之refusing to merge unrelated histories
- git pull失败,提示:refusing to merge unrelated histories异常解决方案
- git pull 失败 ,提示:fatal: refusing to merge unrelated histories
- git-bug-“refusing to merge unrelated histories”
- Git创建问题-fatal: refusing to merge unrelated histories
- git fatal: refusing to merge unrelated histories