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
Sorry this is another command-line answer, but that's what I was looking for when I found this question and many of these answers were helpful. My solution is the following bash shell function:
get_branch () {
git rev-parse --abbrev-ref HEAD | grep -v HEAD || \
git describe --exact-match HEAD 2> /dev/null || \
git rev-parse HEAD
}
This should always give me something both human-readable and directly usable as an argument to git checkout
.
feature/HS-0001
v3.29.5