执行 git 把 laravel 上传到 GIthub 出现的错误以及解决方案

执行 git 把 laravel 上传到 GIthub 出现的错误以及解决方案

1
2
3
4
5
6
7
8
9
10
11
zhihu [master] git pull origin master
warning: no common commits
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (5/5), done.
1 Merge branch 'master' of github.com:aopao/Dahan
remote: Total 9 (delta 0), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), done.
From github.com:aopao/Dahan
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
fatal: refusing to merge unrelated histories

解决方案:

1
git pull origin branchname --allow-unrelated-histories
1
2
3
4
git pull origin master --allow-unrelated-histories
git merge origin origin/master
... add and commit here...
git push origin master