This message was deleted.
# how-do-i
s
This message was deleted.
d
there might be a
gt
way to do it, but there's an undocumented 3rd option where you:
Copy code
# 1. get up to date with main
git checkout your-mega-branch
git fetch origin main
git rebase origin/main

# 2. reset your commits back to "unstaged" changes on your branch
git reset origin/main

# if you run git status now, you'll see all your changes as red unstaged

git add file_for_pr_1.txt
git commit -m "feat: the feature for branch 1"

git add . # add the remaining
git commit -m "feat: the rest of the enchilada"
now you can
gt branch split
and easily pick the 2 commits as your 2 branches
basically "reset + manually make the commits you want, however you like doing that best"
p
I ended up using a workaround where I created a new branch with the one file, then I restacked my old branch onto it
d
i'd say do whatever makes mental sense to you!
@Jacob Gold did i give the right advice here?
j
Yep, there's no way in the
add -p
interface which split is currently based on to do either of those things, I believe
git add -i
does have a way to do taht, but we chose not to leverage that for split I think in the future we make this UX native to gt, but we haven't been able to priotize that yet
d
one possible option would be to rewind their changes and drop them into the
git reset origin/main
state i mentioned above • with instructions to create commits & run
git branch split --by-commit
after to remake the branches • and a
gt abort
kind of command to reset things