How to remove git repository created on desktop

半世苍凉 提交于 2019-12-20 17:26:41

问题


I accidentally made my Desktop a git repository. How to remove the git-related files from Desktop?

  • I have tried to go to C:/User/my_user/Desktop and un-hide hidden git files but couldn't un-hide them.
  • Then I tried to delete the files using Windows Powershell but it isn't listing these files either.
  • I have also tried finding options in GitExtensions for some option to delete the git files but couldn't find any such option.
  • Couldn't find option in Git GUI

There is a git repository for sure because I can use GitEx Browse option in the right click menu.


回答1:


remove the hidden folder named .git from your Desktop




回答2:


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




回答3:


Display the hidden folders: $ ls -alh . Remove the .git folder: $ rm -R .git




回答4:


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...)




回答5:


^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)




回答6:


Go to your project directory and execute the following command on windows rmdir /s /q .git that will remove all of the git references.



来源:https://stackoverflow.com/questions/17369850/how-to-remove-git-repository-created-on-desktop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!