Skip to content

Instantly share code, notes, and snippets.

@drosenstark
Created February 8, 2015 07:29
Show Gist options
  • Save drosenstark/1996068a3e858fedd9b2 to your computer and use it in GitHub Desktop.
Save drosenstark/1996068a3e858fedd9b2 to your computer and use it in GitHub Desktop.
Git Commit2
tempFile='/eraseme/git-commit-template'
git config commit.template "$tempFile"
rm $tempFile
branch=$(git symbolic-ref HEAD|sed s#refs/heads/##) exec 3<> "$tempFile" && awk -v TEXT="$branch" 'BEGIN {print TEXT}{print}' "$tempFile" >&3
git add .
git commit -a
read -p "Press enter to push to server..."
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment