Skip to content

Instantly share code, notes, and snippets.

@schnell18
Created February 18, 2014 06:58
Show Gist options
  • Select an option

  • Save schnell18/9065883 to your computer and use it in GitHub Desktop.

Select an option

Save schnell18/9065883 to your computer and use it in GitHub Desktop.
Get current branch name in script
# Quirk and dirty solution
git branch | grep '*'
# Use Git's plumbing command
git rev-parse --abbrev-ref HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment