I\'m from a Subversion background and, when I had a branch, I knew what I was working on with \"These working files point to this branch\".
But with Git I\'m not sur
For my own reference (but it might be useful to others) I made an overview of most (basic command line) techniques mentioned in this thread, each applied to several use cases: HEAD is (pointing at):
Results:
git branch | sed -n '/\* /s///p'
master(detached from origin/master)(detached from origin/feature-foo)(detached from v1.2.3)(HEAD detached at 285f294)(detached from 285f294)git status | head -1
# On branch master# HEAD detached at origin/master# HEAD detached at origin/feature-foo# HEAD detached at v1.2.3# HEAD detached at 285f294# HEAD detached at 285f294git describe --all
heads/masterheads/master (note: not remotes/origin/master)remotes/origin/feature-foov1.2.3remotes/origin/HEADv1.0.6-5-g2393761cat .git/HEAD:
ref: refs/heads/mastercat: .git/HEAD: Not a directorygit rev-parse --abbrev-ref HEAD
masterHEADgit symbolic-ref --short HEAD
masterfatal: ref HEAD is not a symbolic ref(FYI this was done with git version 1.8.3.1)