I've made a few commits and now I want them (say from some commit in the branch) to move them into a new branch, i.e.:
master - O1-O2-O3-X-C1-C2-C3
to become
master - O1-O2-O3-X
\ new_branch - C1-C2-C3
After that I need to make patches for the mentioned commits (C1, C2, C3) so that a friend of mine would be able to apply them on their tree.
As to the first part I suppose I should do something like:
- Create patches for x -> C3
- Reset to X
- Create branch
- Apply patches
Although here they suggest that I could use git branch new_branch; git reset --hard X; git checkout new_branch
. Wouldn't reset --hard
delete my commits?
I'm not too good with git to do it all without guidance. Thanks!