What is the .git/branches folder used for?
git
Solution
The now "slightly deprecated" use of `.git/branches` is described in the useful `gitrepository-layout` documentation:
branches: A slightly deprecated way to store shorthands to be used to specify URL to git fetch, git pull and git push commands is to store a file in branches/<name> and give name to these commands in place of repository argument.
In the comments above, the question was raise of why some people have this directory and some don't. It seems that a commit was introduced in 2009 that stopped git from creating the `.git/branches` directory by default. However, more recently that change was reverted (i.e. meaning that the `.git/branches` will be created on `git init`, etc.), with the following justification from Junio C. Hamano:
There is not enough justification for doing this. We do not update things in .git/branches and .git/remotes anymore, but still do read information from there and will keep doing so.
Besides, this breaks quite a lot of tests in t55?? series.
Problem
I have always assumed that the `.git/branches` directory is for legacy purposes and that git used to use that directory, but now uses the `.git/refs` directory instead. Is this true? If not, then what is the purpose of that directory since I have never seen it used or referenced. EDIT I'm using git version 1.7.3.4.