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?
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.
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.
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
As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot