Skip to content

Instantly share code, notes, and snippets.

@tonyghita
Created June 25, 2012 16:56
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 tonyghita/2989861 to your computer and use it in GitHub Desktop.
Save tonyghita/2989861 to your computer and use it in GitHub Desktop.
git hook which prepends the branch name to the commit message
#!/usr/bin/env ruby
branchname = `git describe --contains --all HEAD`
message_file = ARGV[0]
message = File.read(message_file)
File.open(message_file, 'w') {|f| f.write branchname + message }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment