Please let me squash a merge commit
2026-04-30 05:28 UTC
Replies (10)
-
@Quantenteilchen@discuss.tchncs.de 2026-04-30 06:29
I never thought about it and instantly wanted to reply “wait why can’t you do that‽” but now that I thought about it, what would you want the history to look like in that case? A slightly weird rebase? A single commit which seemingly copy pasted the entire other branch with no relation to it left behind?
-
@mycodesucks@lemmy.world 2026-04-30 06:46
If you were gonna something you should’ve replaced “vegetables” because squash is a fruit.
-
@jaybone@lemmy.zip 2026-04-30 07:51
But all intersections are squash.
-
@JATothrim_v2@programming.dev 2026-04-30 09:51
Replicating git history for a file takes 1 merge commit and 3 commits, and this is propably one of the most complex workflows I have encountered: (might not be correct...) git checkout -b work git mv file file.tmp git commit git checkout -b copy HEAD^ git mv file file2 git commit git checkout work # can be skipped if you merge "work" instead. git merge copy # "work" and "copy" must conflict, stage file.tmp and file2 and commit the result. git mv file.tmp file git commit I would love to squash this into a single commit, but git doesn’t have a copy operation or detection. :(
-
@trem@lemmy.blahaj.zone 2026-04-30 12:48
You might prefer working with rebases + fast-forward-only merges, if you want merge commits to be squashed…
-
@Shameless@lemmy.world 2026-04-30 15:31
As long as it merges it’s fiiiine!
-
@goatinspace@feddit.org 2026-04-30 20:19
-
@zen@lemmy.zip 2026-04-30 21:24
Ah yes, the vegetable and sports git merging strategies. I personally prefer rebase myself, but that’s okay.
-
@greedytacothief@lemmy.dbzer0.com 2026-04-30 23:09
Can you get squash (juice concentrate) in the US? I took a shine to it in the UK, but all I can think that we have here is the frozen concentrate and maybe like some lemonade concentrate in a carton.
-
@wonderingwanderer@sopuli.xyz 2026-05-01 03:15
You forgot read-only filesystems