piggy back off the FB questions: 1. `hg split` us...
# how-do-i
p
piggy back off the FB questions: 1.
hg split
used to let you split 1 diff into 2 separate diffs on the stack, is there an equivalent command (gt split seems different) 2. there used to be a command that would let you amend existing changes down the stack. so if you added a function in diff 1 and then at the top of the stack you realized you need to make changes to that function there was a command that would guess which diff the changes should apply to so in this case diff 1
d
for 1),
gt split
does do what you describe i plan to document this soon a bit better, but you have a couple options here: 1. use
gt split
in hunk mode - it will rewind your branch to unstaged changes, and prompt you what changes you want in diff 1. it will then go back around and prompt you for what you want in diff 2. etc, etc, until you run out of changes to commit 2. use
gt split
in commit mode - if you already have 2 distinct commits in 1 branch/diff that you want to turn into 2 branches, you can select those i tend to gravitate towards: 1. rewind my branch manually in
git
2. commit the exact commits that i want to turn into separate PRs 3. use
gt split
in commit mode to quickly make the split PRs
for 2), I think you're describing something called
absorb
which i know is on our roadmap for exploring, but not sure when that's being picked up!
p
Ah perfect thanks for all the context! Really helpful
d
yep, thanks for giving me some more signal that
gt split
is a bit confusing off the jump 🙂