When I start an interactive rebase in sourctree, there's an option 'Amend commit?'.
I was expecting ticking this option would put me into something similar to git gui's "amend last commit" feature - I'd see what was staged, what wasn't staged, unstage hunks/lines, etc.
What actually happens is that I just get shoved into a state where I'm not sure what the state actually is. It definitely thinks it's in a rebase, but there's no files shown in the staged area of the working copy.
How do I remove a hunk from the commit that I didn't mean to commit?
Hey Joseph,
The amend feature in interactive rebase allows you to drop in on any commit and make any changes, thus creating a new commit. So out of 10 commits, the 5th commit has something in it I'd like to change, so I hit amend on that one which will drop me back out to SourceTree still in a rebase mode. I can make changes and then hit commit.
At the moment SourceTree forces the 'Amend commit' checkbox in the commit sheet. This will cause the rebase process to continue once you've amended the commit you chose.
Feel free to ask more questions if you have any - we've been planning on writing a guide to this for some time.
Cheers
Thanks Kieran! At least from the perspective of someone coming from git gui, I have to say that I find sourcetree's amend commit view confusing. I'd feel far happier if the commit window showed me the final state the amended commit will end up in, whereas I believe it's showing me the changes that will be applied to the commit, if that makes sense.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi May I Know how can we apply git commit --amend on 5th commited one
Actually, I able to apply $git commit --amend -m "my msg" Which effects on latest commit.
Can You tell/suggest if it possible to apply on amend on any committed message out of 10 other than latest..
Thanks in advance
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BRANCHES > Right Click on commit on top right table > Rebase children interactively > Edit Message .. on Mac
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.