有两种方式进行,最快的是直接
git clone 那个远程的仓库,本内容主要讲解后一种方式的。
首先,对于Fork到本地的仓库,需要新建两个分支:
git checkout -b master
git checkout -b NewMaster
随后添加远程仓库,添加的仓库有两个,一个是自己fork完之后的自己的仓库链接,一个是fork别人的链接。
git remote add origin "自己的链接"
git remote add origin1 "fork的那个链接"
切换到NewMaster分支,拉去仓库内容,若是显示
fatal: refusing to merge unrelated histories,则需要在pull那里添加参数
git checkout NewMaster
git pull origin1 master --allow-unrelated-historie
切换回Master分支,并将NewMaster分支合并到一块
git merge NewMaster
此时就可快乐的将仓库内容提交到远程仓了,冲突问题完美解决
git add .
git commit -m "解决冲突"
git push master origin
!注意各个部分的origin是什么