I have a series of commits (20+) that pertain to a particular feature that I am trying to remove from our master branch and into a separate branch.
I have a tag (rel_2009_07_18
) on the commit that represents our latest stable release, so when on master, git log rel_2009_07_18
..HEAD gets me the set of commits that I want to move to a separate branch. There are also some commits in this set that should remain, but I could just cherry-pick those as they are few.
I've looked at git filter-branch, but the commit option mentions leaving the changes in but removing the commit -- definitely don't want that. I also looked at git rebase, but that also mentions reapplying the commits to the upstream branch.
Is there a good option for moving these commits to a separate branch?
I'm not sure if this is a viable option and the repercussions in a distributed, albeit small (3 developers), environment. But could I perform the following little shift...
- Locally rename the master branch to master_plus_feature (or similar...)
- Checkout from the `rel_2009_07_18` tag
- Create a new branch master from this point
- Delete remote branches and re-push from local
Thoughts and suggestions? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…