links: Git MOC


When you clone a repo with depth 1 or something similar, you don’t see other branches

In Order to get all other branches, you need to update git config

  1. Run
git remote set-branches origin '*'

This updates the config from

fetch = +refs/heads/master:refs/remotes/origin/master

to

fetch = +refs/heads/*:refs/remotes/origin/*
  1. Aftet that, git fetch -v
  2. Finally git checkout the-branch-i-ve-been-looking-for

tags: git, branch, shallow-clone, clone