Question: how are git branches stored?
Answer: Git stores all references under the . git/refs folder and branches are stored in the directory . git/refs/heads . Since branch is a simple text file we can just create a file with the contents of a commit hash.