Slackbot
08/30/2023, 6:27 PMDavid Balatero
08/30/2023, 6:48 PMgt way to do it, but there's an undocumented 3rd option where you:
# 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 branchesDavid Balatero
08/30/2023, 6:48 PMphou
08/30/2023, 6:49 PMDavid Balatero
08/30/2023, 6:49 PMDavid Balatero
08/30/2023, 6:50 PMJacob Gold
08/30/2023, 6:59 PMadd -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 yetDavid Balatero
08/30/2023, 7:01 PMgit 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