Geo*_*nza 91 git synchronization github
我在github上分了一个项目,做了一些改动,到目前为止一直很好.
与此同时,我分叉的存储库发生了变化,我希望将这些更改存入我的存储库.我怎么做 ?
Let*_*_Be 72
通常git pull
是足够的,但我不确定你选择了什么布局(或者为你选择了github).
Mar*_*erd 61
假设他们的更新是在master上,并且您在分支上,则要将更改合并到.
git remote add origin https://github.com/<github-username>/<repo-name>.git
git pull origin master
Run Code Online (Sandbox Code Playgroud)
另请注意,您将要将合并推送回存储库副本:
git push origin master
Run Code Online (Sandbox Code Playgroud)
Ale*_*lex 45
您必须将原始仓库添加为上游.
这里有很好的描述:https://help.github.com/articles/fork-a-repo
git remote add upstream https://github.com/octocat/Spoon-Knife.git
git fetch upstream
git merge upstream/master
git push origin master
Run Code Online (Sandbox Code Playgroud)
您需要将原始存储库(您分叉的存储库)添加为远程存储库.
git remote add github(orignal repository的clone url)
然后,您需要将更改引入本地存储库
git fetch github
现在,您将在本地存储库中拥有原始存储库的所有分支.例如,主分支将是github/master
.有了这些分支机构,您就可以做到.将它们合并到您的分支机构等