considering:
- https://github.com/whoever/whatever.git is the address of original repo
- https://github.com/youraccount/whatever.git is the address of fork repo
clone your fork if you haven't cloned already
$ git clone https://github.com/youraccount/whatever.gitadd original repo as upstream if you haven't done already
git remote add upstream https://github.com/whoever/whatever.gitfetching upstream
git fetch upstreamconfirm you are in master branch
git checkout mastermerge local
git merge upstream/masterpush merge
git push origin masterSometimes you prefer to perform a full reset of your fork the following instructions will erase all modifications from your fork and sync it with original repo !!! note that any modification in your fork will be lost !!!
add upstream as before if not yet
git remote add upstream /url/to/original/repofetching upstream
git fetch upstreamconfirm you are in master branch
git checkout masterhard reseting your local repo from upstream be careful! This command you override everything locally!
git reset --hard upstream/masterpushing local repo to remote fork !!! note that this command will override any change in remote fork with local repo!!!
git push origin master --force