I have forked a repository on github some time ago, made a small change and pushed the change back to my github fork. The original repository has changed since. I would like to merge the changes from the original repository to my fork.
I am new to both git and github, and I need specific commands how to do it.
Example:
will do the job creating additional merge commit. If you do not have conflicts and do not want to create a rejoin (with additional 'merge' commit) for every commit that you push then
rebase
is more preferred. You can do it with the Git Gui+gitk. Just fetch remote withGit Gui
then open history withgitk
and create temporaryr_master
branch atremotes/origin/master
fetched. Finally, callgit rebase r_master
in thegit bash
. This will place your commits on top of the remote modifications. You are ready to push and remove ther_master
.This comment suggests that there are shortcuts for this flow.
Simply add original repo as a remote and merge your fork with it; then push merged fork to github.
There's also a ruby gem for easier github operations. You can merge upstream with one call...
Syncing a fork
(from GitHub Help)
https://help.github.com/articles/syncing-a-fork