Stacked Diffs with git rebase —onto
dineshpandiyan.com
Stacked Diffs with git rebase —onto
1–10 of 210 posts
Re: Stacked Diffs with git rebase —onto
#2I consider myself a shmedium experienced dev who likes to learn their tools and read source.
This seems like a house of cards whose juice isn’t worth the squeeze. But I would love to split up my PRs into smaller pieces.
I just would hate to waste time with an incomprehensibly goofed git history because I forgot a command.
Re: Stacked Diffs with git rebase —onto
#3I usually just `git rebase origin/main -i` after the base branch has been merged there, and this means I need to explicitly drop the merged commits, but I can inspect what's happening.
Re: Stacked Diffs with git rebase —onto
#4I'm a heavy user of git-spice: https://abhinav.github.io/git-spice (created by a former coworker) and can't really go back to a time without it. While still not nearly as good as Facebook's Phabricator, it's probably the best workflow for small, focused stacked PRs you can achieve in a Github / Gitlab based repository.
Re: Stacked Diffs with git rebase —onto
#5I think ‘git rebase —-update-refs’ is the better way to go for this scenario
Re: Stacked Diffs with git rebase —onto
#6Jujutsu comes in handy here for the same usecase:
https://www.stavros.io/posts/switch-to-jujutsu-already-a-tut...
Also found https://github.com/gitbutlerapp/gitbutler
Re: Stacked Diffs with git rebase —onto
#7This 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.
Re: Stacked Diffs with git rebase —onto
#8Jujutsu comes in handy here for the same usecase: https://github.com/jj-vcs/jj https://www.stavros.io/posts/switch-to-jujutsu-already-a-tut... Also found https://github.com/gitbutlerapp/gitbutler
The main issue I kept having when trying to do this with just git is then managing all the branch names to be attached to the right moved commits, so that my stack could be reviewable on github's open PRs.
Does jj help with that at all?
I've experimented a bit with git-town.com (OSS) and now everyone at $DAYJOB uses graphite.com (SaaS) which does that part very well.
Re: Stacked Diffs with git rebase —onto
#9That particular case can be solved much easier by rebasing outer-most branch with `--update-refs` flag.
Re: Stacked Diffs with git rebase —onto
#10GitButler handles all of this pretty automatically, if you don't want to deal with the Git gymnastics needed here.