Skip to content

Home

Get the current branch name

Prints the current branch name.

git rev-parse --abbrev-ref HEAD

# Examples
git checkout patch-1
git rev-parse --abbrev-ref HEAD # Prints `patch-1`

More like this

Start typing a keyphrase to see matching snippets.