Skip to content

Instantly share code, notes, and snippets.

@gnarf
Created July 5, 2012 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnarf/3056078 to your computer and use it in GitHub Desktop.
Save gnarf/3056078 to your computer and use it in GitHub Desktop.
bash script to copy author and hash from current commit
gitvars() {
export author="$(git log --format='%an <%ae>' HEAD -n1)"
export hash="$(git log --format='%H' HEAD -n1)"
echo "\$author=\"$author\""
echo "\$hash=\"$hash\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment