hcker2000
hcker2000

Reputation: 615

New repo or new folder in repo?

So when it comes to re-writing a whole system do you prefer to make a new repo for the re-write or just a new folder in the existing repo?

The reason I ask is the new folder method requires some for though for the directory structure as you would need to start with some thing like.

/root
/root/v1/

Then add

/root/v2

Upvotes: 1

Views: 236

Answers (2)

Martin Geisler
Martin Geisler

Reputation: 73748

You forgot the third option:

  • rewrite the software in-place, without creating a new folder.

You use version control exactly so that you don't need to create folders per version.

To expand on the above a bit: if new system is radically different from the old system — a complete rewrite like you say — then I would probably use a new repository. If the rewrite is more incremental, then I would keep the existing repository.

Add a tag when you start the re-write or do the re-write on a dedicated branch, that way you can keep track of where the old code ends and where the new code starts. With a distributed version control system like Mercurial or Git, you could just create another clone on your server for the re-write.

Branches are a very powerful tool. I've written a tutorial for Mercurial about branches that you might find interesting. There you see Alice and Bob working in parallel on several branches. In your case, you would still be able to add stuff to the old code while working on the new code.

Upvotes: 4

wildpeaks
wildpeaks

Reputation: 7392

I would go with a new branch of the repository if the new system is meant to be structured differently internally but that it interfaces with the rest of the system in the same way as the old version (e.g. the backend of a web application).

If it's both completely different internally and interfaces with the rest of the system in a different way than the old version, then I'd go with a different repository because it's more a new product than just a rewrite.

Upvotes: 1

Related Questions