We developed a product (prototype) P_OLD in language X and we are now rewriting it from scratch as P_NEW in language Y.

Since P_NEW and P_OLD are the same product:

Should P_NEW just be a brach of P_OLD old or should it be its own repository?

What is the usual way to handle such big changes form a version control perspective?

  • related (possibly a duplicate): Choosing between Single or multiple projects in a git repository?
    – gnat
    Commented Jul 14, 2015 at 18:55
  • @gnat Thanks for the link. It is interesting, but the main difference is that for us it's the same product, just completely redesigned. The old project was basically an (ugly) prototype.
    – 1v0
    Commented Jul 14, 2015 at 18:58

3 Answers 3


You almost certainly want a new repository.

The purpose of the repository is:

  • to track history and changes so you can compare them easily
  • to manage branches and merges rather than just emailing patch files around and applying them to working directories manually

If you're totally rewriting a project from scratch then there is no point putting the rewrite in the same repository. You won't be able to apply patches written in the old language to your rewrite. Switching repos won't make the history in the old repo go away, andif you switch you won't have any weird interim stages where you have two languages kicking round in your repo.

The only reason I would even consider keeping the repository when changing languages would be if a) the languages are so similar that code can often be copy-pasted from one to the other without making any changes, or b) you have a project in which the majority of the functional content in version control is something like templates in a templating language you're retaining, and the language of the core which you're changing be translated line-for line into another language (and even then only if you know you're going to need to keep iterating the templates during the migration).

  • 2
    Depending on the length of the transition, it's useful to have the previous alive and readily accessible for comparisons. You might even be introducing test cases in the old system to help you validate that results match in the new system.
    – Eric
    Commented Jul 15, 2015 at 2:40

I always put rewrites in new repositories myself. That way the builds, tests, and deployments can all be done independently.

When you're rewriting a project in another language there's often very little similarity in any of those tasks like building, running tests, and deploying. You'll save yourself pain if you just isolate them in their own repository. Then you'll only need to worry about the pain of how you're going to manage the user and data transition from the old system to the new; that's always a fun thing. :)


If your systems are sufficiently modular and link compatible, you would benefit from a single repository and build. For example, if C system is being rewritten in C++, the C++ code could call existing functionality and incrementally replace it.

However, even in this case some might argue for starting a new repo in which relevant old code is pulled in as required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.