I just ran git init
on an already existing git repo.
The result is Reinitialized existing Git repository
How can I undo this?
Thanks!
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).
You can do this, and it will not affect your remote repos at all (you'd have to delete those seperately if that is what you want). delete on local, than checkout the repo again ;) @Thilo - exactly just remove the . git directory, run git init, remove all your remote repos and push again.
No need - it is quite safe to do. From the documentation:
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.
The templates are files such as the sample hooks and example files that are part of git. If you have updated git since creating the repo and these files have changed, they will not be updated - only new files will be added. Since none of these files are actually 'active', this should be entirely safe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With