Home > front end >  Reset DEVELOP to MASTER but keep the old develop
Reset DEVELOP to MASTER but keep the old develop

Time:11-14

Our develop branch is way too messy and we have not been using it in a while, so all the features come from a new branch that was created from master a while ago.

I want this branch that we call "bugfix" to become our new develop and so we can go back into the old git flow.

The problem is we still have things in develop that I am gradually cherrypicking and commiting as new features, so I must keep the old develop somewhere, a branch prehaps.

How can I do this? I was thinking about creating a branch called "develop-old" from "develop" and pushing it to origin, then resetting the "develop" into the "bugfix"

Would that work? Is there a better way of doing this?

CodePudding user response:

I was thinking about creating a branch called "develop-old" from "develop" and pushing it to origin, then resetting the "develop" into the "bugfix" Would that work?

Yes.


A branch in git is just a pointer to a commit. It has no permanent presence, and no metadata other than its name, so you can create, delete, and rename branches at will.

To create your new branch, just run git branch develop-old develop and git push origin develop-old. Then you can either delete develop and rename bugfix; or reset develop to point at the same commit as bugfix then delete bugfix.

  • Related