Sync a fork from original repository

Git

Sync a fork of a repository to keep it up-to-date with the upstream repository.

This will pull all new changes from upstream, sync, and push the changes to the fork.

If you prefer to rebase upstream:

sh

git fetch upstream git checkout master git rebase upstream/master git push master

Or add this alias to your profile

bash

alias gf="git fetch upstream -p && git rebase upstream/master && git push"

If you prefer to merge upstream:

sh

git fetch upstream git checkout master git merge upstream/master git push master

Or add this alias to your profile

bash

alias gf="git fetch upstream -p && git merge upstream/master && git push"