Say you've added a few files to a commit and you decide later to move it to a different branch. You need a couple of git commands:
First. You need to split the commit into multiple commits which done via an interactive rebase:
-
git rebase -i HEAD~n
(the number of commits you want to go back - https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History (look for splitting a commit) Show archive.org snapshot
- adjust branch to look the way you want
- then do a
git rebase --onto
Posted by Chris to Chris's deck (2019-09-23 18:46)