Skip to content

Instantly share code, notes, and snippets.

@alebaffa
Last active September 15, 2017 03:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save alebaffa/d127d79fb241fbe5f041ff1001eec8c8 to your computer and use it in GitHub Desktop.
Get name of the current branch in git
branch="$(git rev-parse --abbrev-ref HEAD)"
echo ${branch}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment