According to the git documentation, git clone creates remote-tracking branches for each branch in the cloned repository. However, today I was setting up a new machine image on Ubuntu 14.04, and in the process upgraded my git from 1.7.9.5 to 2.0.2. When I was attempting to use capistrano to deploy code from a different (non-master) branch to the box, it was failing, and I tracked down the root cause to the issue that git clone --depth 1
(the command that cap generated and uses) was not creating remote tracking branches for each branch. As a result, attempting to reference a checkin from said non-master branch failed. I did a
git branch -r
And saw that only
origin/HEAD -> origin/master
origin/master
Were shown, not all of my other branches too.
I see that there were some behavior changes introduced in git 1.9, also referenced on SO here.
Can someone explain why this change causes the behavior I am now seeing, and what the command is that I would need to now execute to get this working as it did under git 1.7?
Thanks!