8

We're using Git as our source control system, and I like to commit my code on a regular basis. This does mean that when I'm ready to push to the shared repo I've created quite a few nonsense commits that I'd like to squash away before pushing.

Using SourceTree that should be a simple thing, but I keep running into issues where not all selected commits are being squashed together. Let me show some images of what I do using a sample repo with some checkins:

Initial situation

I click the first checking and choose to 'rebase children interactively'

Context menu

A pop will appear with all the checkins:

Popup

On this popup I click the 'fifth' checkin and hit the squash with previous 3 times until the screen looks like this:

Squashed in popup

All's fine you'd think, but then when hitting the 'ok' button, this is what I end up with:

End result

Why oh why does it not include the 'Second' commit in the end result? Judging by the looks of the popup you'd think this is included as well. I can do the same thing again to get the second in there, but I just can't fathom why it works this way or how to squash them all in one go.

Any help would be appreciated.

Robba
  • 7,684
  • 12
  • 48
  • 76
  • 1
    Odd. This sure looks like yet another argument to shun the fancy GUIs (which is my method: stick with CLI whenever possible for things I work with every day). – torek Feb 14 '17 at 17:12
  • this is not how you do it. you drag the one's you want to squash into the "squasher" commit – FlavorScape Apr 04 '17 at 21:27
  • I have this problem as well. I believe it is a bug. SourceTree will not squash the last item in the list. It is a bloody nightmare!!! – Charles Robertson Apr 22 '21 at 06:49

1 Answers1

3

It was a bug in SourceTree, see this bug report. According to the bug history, it was closed as fixed in May 2021.

knittl
  • 246,190
  • 53
  • 318
  • 364