I accidentally created a Git repository in my home folder. I was wondering what's the best way to remove the repository and it never happening again.
Asked
Active
Viewed 2,883 times
2
-
https://stackoverflow.com/search?q=%5Bgit%5D+undo+init – phd Sep 20 '20 at 18:39
-
This the mistake i was doing i was not moving to the project dirctory "If you have a project directory that is currently not under version control and you want to start controlling it with Git, you **first need to go to that project’s directory**. If you’ve never done this, it looks a little different depending on which system you’re running:” Excerpt From Pro Git Scott Chacon This material may be protected by copyright." – Fahad Jul 19 '22 at 22:55
-
1Not a big mistake. If you've run `git init` in a directory where subdirectory `.git/` already exists — nothing happens, nothing to fix. If you've run `git init` in a directory where `.git/` doesn't exist — also not a major problem; just do `rm -rf .git` and go on. – phd Jul 19 '22 at 23:52
1 Answers
4
happened to me as well, type this in the same directory. just make sure you make a new folder next time before git init
rm -rf .git

cdub
- 80
- 6