Skip to content

Instantly share code, notes, and snippets.

@lsaffie
Last active November 4, 2016 21:25
Show Gist options
  • Save lsaffie/65eb9b315b2c66ae1ab797127aacddff to your computer and use it in GitHub Desktop.
Save lsaffie/65eb9b315b2c66ae1ab797127aacddff to your computer and use it in GitHub Desktop.
git hook: appends branch name on every commit
#!/bin/bash
# Place this in <project_name>/.git/hooks/prepare-commit-msg
git branch | sed -n '/\* /s///p' >> $1
@DaneGardner
Copy link

You just opened up a whole new world for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment