Git branch not returning any results

That’s because you have not yet committed anything, when you do git checkout -b test, git modifies content of the .git/HEAD file from ref: refs/heads/master to ref: refs/heads/test, which actually points to nothing. Only after you make a commit will git create the test refs for you and you will find a .git/refs/heads/test file, which contains the hash of the commit you just made.

Leave a Comment