Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@imaizume
Last active June 6, 2017 02:35
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 imaizume/35ed1209ec4ca29c74ec8d0617b6892c to your computer and use it in GitHub Desktop.
Save imaizume/35ed1209ec4ca29c74ec8d0617b6892c to your computer and use it in GitHub Desktop.
新規にブランチを作成したら自動で空コミットを作成するgit hook
#!/usr/bin/env ruby
before, after, switch = ARGV
exit 0 unless before == after
exit 0 unless switch.to_i == 1
branch = `git rev-parse --abbrev-ref HEAD`
msg = "Created new branch #{branch}"
system(%(git commit --allow-empty -m "#{msg}"))
@imaizume
Copy link
Author

imaizume commented Jun 6, 2017

Correct quote wrap problem for commit massage.

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