Is there a way to modify the commit message for the current commit using SourceTree? Currently, I have to go to the command-line and run the following:
git commit --amend -m "New Message"
Yeah, you can do this: there's a checkbox at the bottom left of the Commit dialog which says 'Amend latest commit', when you check it the previous message will appear in the box and you can edit it, then hit Commit to modify it. You can even change the contents of the commit if you want (file changes). Obviously make sure you haven't pushed your changes before using this :)
Ah, thanks Steve :) That's exactly what I was looking for. I thought I remembered that being there somewhere but just couldn't find it when I searched ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IIRC, this command has the disadvantage to also commit staged files. If you want to only edit the last commit message without touching the index or working tree, it will be a little bit more complicated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You say it will be a "little bit more complicated" but you don't actually mention if it's possible to do so with SourceTree :) And if it is possible, how to do it ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to change the last commit's message without touching the index or working tree, you need to create a temp file, amend-commit this addition, remove the file and amend-commit this removal with the new message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.