Question

I would like to know how do what I want to do.

For the moment I'm working on the master branch. But this branch will change because all the source code will be updated. In fact, I would do like a "screenshot" of my current branch and load it after, if I want. I want this screenshot contains all the source code because I'll remove completely the actual source code (change framework, architecture, etc.)

So, I think I have to do a new branch with the actual source code and remove the source code of the master branch, change the framework and work on it. But I'm not sure that's the better way to do this.

Do you have advice about that? Thank you.

Was it helpful?

Solution

You can do:

  • a tag, referring your current commit on master
  • a branch starting from your current master

Then you can:

  • push that branch
  • push your tag (git push --tags)
  • git rm everything (git rm -r)
  • fill your working tree with the new code
  • add, commit, and push that same master with the new content

Another solution is to:

  • rename master
  • create a new orphan branch named master.

See "How can I completely empty the master branch in Git?".

OTHER TIPS

You have several solutions, here's mine :

  • tag the current master branch, to be able to get the current version whenever you want
  • develop the new framework in a new branch, so you will have the stable current version in the master branch, and you will merge new framework to master branch when ready.

For the moment you just need a tag on your master branch.

Then in the future, if you'll need to modify that "old version" code, you'll create a new branch starting from that tag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top