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

  • Configuring a remote for a fork
$ git remote -v
$ git remote add upstream
$ git remote -v
  • Sync a fork
$ git fetch upstream
$ git checkout master
$ git merge upstream/master
$ git push -u origin master
  • Reference

Written on July 4, 2020