The problem that I and seemingly others here are facing, is this: imaginge three commits, A->B->C (chronological order). Now, say I'd like to squash C into B. Judging from the answer here I should right click on B, select "rebase children interactively", and then be able to do it. But here's the problem: When I do that, only the children of B (aka, C) are shown in the dialog and available interactive rebasing. To do what I originally wanted to do, squash C into B that is, I actually have to right click A, choose, "rebase children interactively", and then B and C show up in the window, I can squash C into B, press OK and it's done.
My question is, is this a bug or is this how it's supposed to be? And if you really want it that way, what's the reasoning behind that decision?
Or, am I just missing something? ;)
@Ludwik Szymon Janiuk That's just how git works. Imagine your scenario: ``` * f5ac8a9 - (HEAD -> master) C * 8667061 - B * 2d19dc0 - A ``` To squash C into B, you would type in `git rebase -i HEAD~2`, which is equivalent to `git reabse -i 2d19dc0`, which would output: ``` pick 8667061 B pick f5ac8a9 C # Commands: # p, pick = use commit etc. ``` So to answer your question, SourceTree is most likely behaving this way on purpose, because it's mimicking how git works.
When clicking the option on the same commit where the 'master' branch is nothing happens at all (dialog does not show up). It only works when performed either on the commit prior or the one after, which makes no sense at all. Usually you want to squish the commits you've been working on in your branch, which directly stem/root in the latest commit on 'master. Is this a bug or a design decison I am misunderstanding?
You'll want to click on the oldest parent commit that you'd like to rebase to. This will allow you to squash any children commits from that point. The graph in SourceTree is upside down, where the parent commits are lower and children commits higher. Does that help explain it? If it doesn't, could you provide a screenshot of what you're trying to do and I might be able to help further.
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
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
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot