git rev-parse --abbrev-ref HEAD
to print the name of the current branch.git rev-parse --abbrev-ref HEAD
git checkout patch-1 git rev-parse --abbrev-ref HEAD # Prints `patch-1`
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️