paul590
paul590

Reputation: 1425

GIT starting project from scratch but want to keep old repo

Hello I have a project that was completed in c# and a git repo was created for it. I am now re writing this project from scratch in java but would like to use the same repo as the original one. Would a branch work in this case? if so, should I move my java project folder inside this c# folder where the repo is found? Please let me know what your recommendations are. The main reason to keep it all in one repo is to have everything in one place for this project. Thank you in advance!

Upvotes: 0

Views: 363

Answers (2)

René Höhle
René Höhle

Reputation: 27285

Normally that what you try make not so much sense. It isn't much more work to have two Repos and two directories to work with. If you need the old and the new version you need two clones otherwise its not working.

If you really want one repo. Then delete all files put in your new files and push them. But then you have to checkout your old version from an old commit every time you need it and that can take some time if you repo have a lot of files.

Your new project is in another language so use a new one. You have no advantages to work with one repo with two different languages in it.

Upvotes: 1

Makoto
Makoto

Reputation: 106389

Git manages source changes. What you're describing is a project change.

In essence, Git doesn't care if you suddenly introduce a new language into your project, but from a policy standpoint, you definitely care how and when this happens. It's ill-advised to suddenly overwrite your history with a new language because this makes it difficult to gain insights into how your older project had been structured, and how it had been functioning prior to rewriting it.

My recommendation would be to create a separate repository. You can absolutely create a branch and work from that in a separate language, but given that the C# code and Java code are incompatible with one another, having them separated out would be the best policy for you.

Upvotes: 1

Related Questions