zlacker

[parent] [thread] 5 comments
1. polite+(OP)[view] [source] 2025-12-05 11:10:35
This marker branch step feels like a workaround to a missing capability. It's something I can easily see one forgetting especially if they haven't been doing stacked diff workflows regularly.
replies(2): >>sublin+Z4 >>imron+x6
2. sublin+Z4[view] [source] 2025-12-05 11:49:37
>>polite+(OP)
I agree it seems error prone. I'm not sure if I'm misunderstanding something, but I use `git cherry-pick` when I know I need to move commits around that might have conflicts. The problem with rebase can be that the user doesn't fully understand all the options being applied and end up with a "bad" merge.

I don't usually want to rewrite history. I just want the target branch with all my commits on top (I usually squash the feature branch into one commit anyway). I have yet to run into a situation where this isn't good enough.

If the branch diverges so much and has so many commits that this simpler approach doesn't work, that might not be a git problem, but a project management one. It's still always nice to know git has tools to get me out of a jam.

replies(1): >>171862+ZP3
3. imron+x6[view] [source] 2025-12-05 12:00:56
>>polite+(OP)
The capability is there.

Just use git rebase --update-refs ...

replies(1): >>url00+ku
◧◩
4. url00+ku[view] [source] [discussion] 2025-12-05 14:18:58
>>imron+x6
Wow you aren't wrong, the first blog post on Google talking about this is exactly what this complicated method does just built-in.
replies(1): >>imron+Bk2
◧◩◪
5. imron+Bk2[view] [source] [discussion] 2025-12-05 23:17:50
>>url00+ku
To be fair --update-refs was only added in git 2.38 (released in 2022) so it’s likely that OPs workflow came about before this flag was introduced.
◧◩
6. 171862+ZP3[view] [source] [discussion] 2025-12-06 16:20:53
>>sublin+Z4
Rebase is just automated cherry-pick, so it ends being the same. The pick command in rebase is exactly that.

> and end up with a "bad" merge.

They end up with exactly the same merge when using cherry-pick directly?

> I don't usually want to rewrite history. I just want the target branch with all my commits on top

That's ... what rewriting history is?

[go to top]