I accidentally started a new git init in an existing git project, what do I need to get it back to normal?

And after that I deleted git init with rm -rf .git and started a new one with git init , did I rm -rf .git up my project? I need my older git configuration in my project, what can I do now?

+7
git version-control github
source share
1 answer

Running git init on an existing project does nothing wrong (it just copies all the new templates) as described in the man page

Running git init in an existing repository is safe. He will not overwrite things that already exist. The main reason for restarting git init is the collection of recently added templates (or moving the repository to another location if --separate- git -dir is specified).

Then running rm -rf .git , you deleted your own repository (I can’t imagine why you expected this command to do anything else). Hope you have backups.

+7
source share

All Articles