Home ›
Set a git commit message in bash but also go to Vim for further editingSet a git commit message in bash but also go to Vim for further editing
Submitted by Benjamin Melançon on June 6, 2012 - 3:21pm
A colleague insists that messages abide by the 72 character limit advisory, and i want to change my habit to get the files-changed and, just as important, files-left-out information that git commit
will give in the Vim editor.
I'm still a bit addicted to the git commit -m "Message here"
workflow of entering messages right in the command line, and it's more than just habit: it is very useful to be able to look at the git add -p
record.
In short what i want to do is both git commit -m
and git commit
. This may be very inelegant, happy to know a better approach with bash or git, but adding these lines to .bashrc does work:
# Commit and leave a one-line message. gcm() { git commit -m "$1"; git commit --amend }
Searched words:
pass a parameter to git commit
Comments
Post new comment