Move All Commits on One Feature Branch to a New Feature Branch
For reasons of admin, and fussiness, I would like to move all work I have on one feature branch onto a new one. On branch feature/old, some commits have been pushed to remote, or I would already have worked something out.
I want to create a new branch, feature/new, based off of branch dev/main, and have all of the work I've committed to feature/old, including what I have pushed, committed to feature/new, but I want all commits on this new branch to be local only.
I tried what I thought would be a simple approach, in which I created feature/new based on dev/main, and checked that out as a clean copy in a new folder, a new working tree. Then I copied all files from feature/old over all files in feature/new, hoping I could just selectively commit only the resulting changes relevant to my work, but things got quite messy very quickly.
I was hoping there was a git guru solution to this where I can work with actual commits and not just changes from file overwrites.
I want to create a new branch, feature/new, based off of branch dev/main, and have all of the work I've committed to feature/old, including what I have pushed, committed to feature/new, but I want all commits on this new branch to be local only.
I tried what I thought would be a simple approach, in which I created feature/new based on dev/main, and checked that out as a clean copy in a new folder, a new working tree. Then I copied all files from feature/old over all files in feature/new, hoping I could just selectively commit only the resulting changes relevant to my work, but things got quite messy very quickly.
I was hoping there was a git guru solution to this where I can work with actual commits and not just changes from file overwrites.