Skip to content

Instantly share code, notes, and snippets.

@timuruski
Last active December 19, 2015 14:39
Show Gist options
  • Select an option

  • Save timuruski/5970687 to your computer and use it in GitHub Desktop.

Select an option

Save timuruski/5970687 to your computer and use it in GitHub Desktop.
Git helper to generate formatted deploy message
# In your ~/.gitconfig
[alias]
deploy = "!source ~/.githelpers && deploy_git_log"
# Add to or create ~/.githelpers and chmod +x
#!/bin/bash
deploy_git_log() {
ref=${1:-'master'}
date +"%d %b %Y"
git log --pretty="tformat: - %s [%an]" origin/$ref..$ref |
sed -Ee 's/\[([a-zA-Z]).+ ([a-zA-Z]).+\]$/[\1\2]/'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment