I forked someone else's project on Github, then modified it and submitted a PR according to the normal process, and the other party merged it.
Now I need to contribute code to this project, but I found that someone else has updated the new code in the other party's project warehouse. How can I synchronize the code of the forked project in my own warehouse to the same latest version as the other party's warehouse? code and then I contribute?
First add other people’s repositories to your upstream remote, usually named upstream. Just do it once.
At this time, use
git remote -v
to see that one origin belongs to you and the other upstream belongs to the original author.Secondly update the code
Use
git fetch upstream
to pull the original author’s repository for updates.Use
git checkout master
to switch to your ownmaster
Use
git merge upstream/master
, merge or rebase to your masterIf the forked code in your warehouse has not been modified since the last time it was merged, then I recommend directly deleting the project in your warehouse and then forking it again.
I personally don’t like the merge method mentioned above -- the history record of the merge method is not very nice.
If you don’t want to delete and re-fork, you can directly:
First add the address of the library you forked
You can see similar ones
Then accept the contents of the forked library
Merge
Just push it to your remote warehouse
These graphic tutorials have been available for a long time. http://blog.csdn.net/qq133247...