Skip to content

Instantly share code, notes, and snippets.

@drewdeponte
Created January 20, 2012 20:02
Show Gist options
  • Save drewdeponte/1649290 to your computer and use it in GitHub Desktop.
Save drewdeponte/1649290 to your computer and use it in GitHub Desktop.
git-current-branch
#!/bin/sh
# Print the current Git branch.
#
# AUTHOR:
# Geoffrey Grosenbach http://peepcode.com
git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment