Published on

Git fetch

Authors
  • avatar
    Name
    Gene Zhang
    Twitter

Rebase local branch to remote main without switching branch

  1. Fetch from origin and update the local main branch:
git fetch origin main:main

Without updating the local main branch:

git fetch origin main
  1. Rebase the local main branch to the remote main branch:
git rebase main