Re: Graphical tool to merge and reorder commits
- From
- Bernd Petrovitsch <bernd@petrovitsch.priv.at>
- Date
- Aug 19, 2025, 09:51 UTC
- Message-ID
- <260a97ce-2ab0-4920-9cea-078369c42f74@petrovitsch.priv.at>
- In-Reply-To
- <aeb06554-77b5-4f07-a659-7b6825d6f3e4@rd10.de>
On 19.08.25 10:35, R. Diez wrote: [...]
Show 20 quoted lines
> I guess some "git history squash" command would be useful too. > > This is what frequently happens to me: > - I commit some code changes because the current project builds and tests fine. > - I start the "compile all projects" process, which takes about 1 hour. > - In the meantime, I commit other unrelated changes. > - After an hour, I realise that a silly mistake in the first commit makes compilation fail for some project. > I fix that and I trigger a "compile all projects" again, which takes 1 hour again. > - In the meantime, I commit yet another unrelated change. > - After yet another hour, the build process notifies me that I made yet another little mistake, and yet another project fails now. > > The commit history looks like this: > > - A - B - fixA1 - C - fixA2 - D - E > > I only do a "git push" when the 1-hour compilation process succeeds. Before the "git push", I want to reorganise that into: > > - A+fixA1+fixA2 - B - C - D - E > > I know I can work with branches, but branches make everything more complicated. A linear history is easier, especially when you are working alone. Besides, it is not often that I make such silly mistakes. ;-)
- `git rebase -i HEAD~11` (or so;-) - move fixA1 and fixA2 under A and change "pick" to "fixup" for fixA1 and fixA2 - save and exit the editor
And done.
Kind regards, Bernd
--
Bernd Petrovitsch Email : bernd@petrovitsch.priv.at
There is NO CLOUD, just other people's computers. - FSFE
LUGA : http://www.luga.at