Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Local git on copied project

I had a previous project that I wanted to use as a starting point for a new project, I simply copied the entire folder as a starting point for the new project.

The issue is, now the new project has the git from the previous project. I want to remove git from the new project, in order to use a new git init.

However, I don’t want to lose any code in the new project, or any git history from the old project.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How do I do this?

>Solution :

in the new copy, remove .git/ directory, which only holds git metadata about the repo. Then you can do a new git init in the new copy and all the same files will still be there.

Since files in .git are likely to be write-protected you may have to force deleteion with rm -rf .git. Just make sure you’re in the correct directory.

However, I don’t want to lose any code in the new project, or any git history from the old project.

make sure you’re in the new copy directory and the old directory will be completely separate and untouched.

wouldn’t hurt to make sure you’re in sync with your remote also and all your branches are pushed, just as a backup.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading