Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

And after that I deleted the git init with rm -rf .git and started a new one with git init, I messed my project? I want my older git configuration on my project, what can I do now?

like image 927
bntzio Avatar asked Sep 02 '14 21:09

bntzio


1 Answers

Running git init on an existing project does not do anything bad (it just copies any new templates), as documented in the man page:

Running git init in an existing repository is safe. It will not overwrite things that are already there. The primary reason for rerunning git init is to pick up newly added templates (or to move the repository to another place if --separate-git-dir is given).

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

like image 114
Greg Hewgill Avatar answered Oct 17 '22 16:10

Greg Hewgill