Rob
Rob

Reputation: 11733

I Know I Can Make an Empty Branch in Git, Should I?

I have some code that is Java EE 5. I want to start porting it to 6.

I was thinking I would do this:

  1. Make a new empty branch (no code in it).
  2. Start writing the 6 code on that branch, no rebasing, etc.
  3. Make topic branches, rebasing/merging to the version branch.
  4. When it's done, make a final version branch from master (of the old version) and delete master.
  5. Make master from the new code.

Does this sound loopy? The project is one war and 2 jar projects. I'd really rather not make 3 new repositories for this.

Upvotes: 1

Views: 193

Answers (2)

Rob
Rob

Reputation: 11733

Ended up making another repository. There is no real reason to try to deliver a completely different codebase from the same repo for one simple reason: no intention of putting any more effort into the Java EE 5 version.

Upvotes: 1

iand675
iand675

Reputation: 1118

Honestly, your system seems convoluted. Why not just branch 6 from 5, make topic branches from 6, cherry pick commits into 5 when necessary, and otherwise do a rolling rebase on top of the 5 branch?

You seem to be thinking like an SVN user here.

Upvotes: 4

Related Questions