It is similar to Make the current git branch a master branch but a bit different.
I have made some commits in master, but now they wont be used, I want to keep them in the future, turning it into a new branch, I want to get a old commit and merge some features (like cherry-pick) and then make this the current master.
.----------E (no branch)
/ /
----A---B---C---D (master)
Version D
is the current master, and I want E
to be the one. I am doing this way:
git checkout A
git merge --no-commit --no-ff D
# do some changes here
git commit -m 'message for E'
This generate a no branch
commit, I was wondering how to turn this into master and turn B
, C
and D
a new branch.
The difference for the answer above is that I do not want E
to be the new branch, I want it to be named master, and change the others to a new branch.