Sync a git Repo with Upstream

April 21, 2021 - Reading time: ~1 minute

Steps to add a remote repo to a local project and sync with it.

  • git remote add upstream # Add the upstream as a remote
  • git fetch upstream # Fetch the upstream
  • git checkout master # Checkout brach to sync with upstream
  • git merge upstream/master # Sync upstream's master branch locally

Categories