I'd like to append (leaving the rest of the commit message intact) a line to my last commit from the command line (ie without having to open my editor). Is there anyway to do this?
Example commit:
git commit -m 'foo'
#foo
Appending the string bar :
git commit --amend -m "$(git log --format=%B -n 1) bar"
#foo bar
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.