January 10, 2013
Once upon a time you found a project on Github that caught your fancy and you made a fork of your very own. You made some changes and time passed. Now you realize that the original project has some new features you want in your fork. What to do?
remote to the original, or upstream project.
You can confirm the remote with this command:
There will (at least) be a pair of references to
origin (your fork of the project) and a pair of references to
upstream, the new remote you’ve added for the upstream project.
##Step 2 Fetch all the changes from the upstream project. This will gather all the branches of that upstream project.
##Step 3 Make sure you are on the master branch of your local repository:
##Step 4 Rebase your branch so that any changes you’ve made which aren’t in the upstream repository are replayed, thus preventing you from losing them.
Push your newly updated local repository to your Github fork. You may need to add the
-f flag to force the push on the initial push after a rebase.