- Show remotes
git remote
git remote show upstream
Clone and rename remote to upstream
git clone -o upstream <repository url>
Rename remote
git remote rename origin upstream
Add new remote
git remote add <remote name> <repository url>
Fetch latest changes from source repository
git fetch upstream
Merge / into current branch (master)
git merge upstream/master
Push to forked repository
git push origin master
Remove all local UNCOMMITTED changes
git reset --hard
Remove all local COMMITTED changes (back to upstream) which are still not pushed to the remote repo
git reset --hard @{u}