I'm new to git and I think I accidentally cloned in the root directory. When I committed one file (index.html) I noticed my whole computer (my desktop, my documents, etc) all in untracked files. I deleted the repository and I want to remove all the untracked files, obviously without deleting everything from my computer. I am new and paranoid about losing my files.
You must have run
git init
somewhere. You need to find the folder you ran this in. Just run:
git status
somewhere you think is now under git "control" and you'll see by the paths: say if you have a path like Desktop/myFolder => you know the folder that contains desktop is you git root folder. Just navigate there and run :
rm -r .git
And all should be back to normal :)
Now that we got the status output :) .. Alright as you can see the root of this thing is you home folder. So just do this:
move to the home folder
cd ~
delete the git repo
rm -rf .git
=> git repo is gone for sure :)
Just Goto C/D or any other drives & run git command 'rm -rf .git'.
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