This message was deleted.
# how-do-i
s
This message was deleted.
s
i had a bunch of commits but some concerns got mixed up so i decided to split the branch by hunk. i ended up with a few branches with separate functionality, but each branch now has one commit. for some branches, i would like to split it into different commits based on files modified.
g
Copy code
gt branch split              Split the current branch into multiple
                               single-commit branches.             [aliases: sp]
This command should help! 🙂
s
thanks, yeah i know about it. but that would create multiple branches. i guess i could do
gt branch split --hunk
and then multiple
gt branch fold
but i was wondering if there's a better way to go from 1 branch with 1 commit to 1 branch with multiple commits.
a
@szaman you can just do general commit splitting.
git reset HEAD~
, and then commit chunks as needed. then do a
gt stack restack
.
s
thanks! seems obvious in hindsight 😅