đź“ť Edit page
âž• Add page
Fetch and update branches
Fetch only default remote
Implied origin
.
$ git fetch
Add -v
for verbose.
Fetch tags
This fetches tags but not branches.
$ git fetch --tags
Fetch all remotes
Useful if you push to say GitHub and BitBucket, or your have origin
for your code of a forked repo and upstream
for the original repo.
$ git fetch --all
Fetch all branches
If you do a shallow clone, you’ll only be able to fetch the default branch and can’t checkout other branches on the remote.
This fixes it. I tested this successfuly after reading this SO thread.
$ git remote set-branches origin '*'
$ git fetch -v