3 ms·
You can use the remote tracking branches if you don't want to make local commits and want them to be automatically updated by fetch. I.e., git checkout or
by jedbrown 13y ago
You can use the remote tracking branches if you don't want to make local commits and want them to be automatically updated by fetch. I.e.,
git checkout origin/interesting-branch
Git will warn you that you're in "detached HEAD" state. When you are making local changes or want to return to where you were, you don't want "git fetch" to have side-effects. Note that you can update local branches without switching to them:
git push . origin/branch-name:branch-name
will fast-forward you local 'branch-name' to match 'origin/branch-name'. It's basically the equivalent of
git checkout branch-name
git merge --ff-only origin/branch-name # or git pull origin branch-name
git checkout the-last-branch-I-was-on
Each remote has its own namespace for a good reason.