Skip to content

Instantly share code, notes, and snippets.

@hotpxl
Last active March 5, 2018 21:52
Show Gist options
  • Save hotpxl/7623952 to your computer and use it in GitHub Desktop.
Save hotpxl/7623952 to your computer and use it in GitHub Desktop.
Prepare commit message for Git
#!/usr/bin/env bash
set -euo pipefail
branch=$(git symbolic-ref HEAD | sed -e "s#refs/heads/##")
sed -i.sed '1 i \
'"[${branch}] " "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment