I accidentally made my Desktop a git repository. How to remove the git-related files from Desktop?
Display the hidden folders:
$ ls -alh
.
Remove the .git folder:
$ rm -R .git
Some suggestions:
- Make sure you are logged in with an admin account.
- Navigate, in Explorer, to "C:/User/my_user/".
- Right-click on 'Desktop' and select the 'Security' tab.
- Make sure 'my_user' has full control over the Desktop folder.
- Windows key->"Folder Options"->View: "Show hidden files, folders, and drives"
Now try to delete the .git dir and related files from Desktop (via command line or Explorer).
(Apologies if you have tried all these things, just trying to be thorough...)
Go to your project directory and execute the following command on windows rmdir /s /q .git that will remove all of the git references.
^C[~ (master #)]$ ls -al | grep .git
You should see the following files: .git .gitconfig
qc^C[~ (master #)]$ rm -rf .git
(recursively remove the .git
file)
If you are a Comamnd Line Freak! You can also do it from your command prompt
Start --> Run
Type: cmd
Navigate to the folder of your project (ex: cd c:\myProject )
From the folder of your project you can type the following to be able to see the .git folder: attrib -s -h -r . /s /d
then you can just Delete the .git folder from the command line: del /F /S /Q /A .git
and rmdir .git
remove the hidden folder named .git from your Desktop