pesader

Checkout the state of a git remote without pulling

Sometimes you want to see what someone else has been up to in their own fork of a project but you don’t to merge their changes into any branch just yet. To do that, run:

git remote add downstream https://gitlab.com/$CONTRIBUTOR/$REPONAME
git checkout downstream/$BRANCH

Later, if you want to update your local references, run:

git remote update

Sources: [1] [2]

Published on April 2, 2023.