How to update a forked repo with git

Access to your fork folder

cd whatever

Add the reference to the original remote repo, called upstream:

git remote add upstream https://github.com/whoever/whatever.git

Get all branch from a remote repo:

git fetch upstream

Go to the brach we want to update such as master:

git checkout master

Re-write our master branch with the new commits from the original master branch:

git rebase upstream/master

Finally, to update our remote fork, follow this sentence:

git push -f origin master

Comments

Popular posts from this blog

How to fix Android when developer options are not available for this user

Exception: Could not find a default OpenFlow controller in Mininet

v4l2: open /dev/video0: Permission denied