How to remove git repository created on desktop

后端 未结 7 836
梦谈多话
梦谈多话 2021-02-04 01:14

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
相关标签:
7条回答
  • 2021-02-04 01:18

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

    0 讨论(0)
  • 2021-02-04 01:21

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

    0 讨论(0)
  • 2021-02-04 01:25

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

    0 讨论(0)
  • 2021-02-04 01:28
    ^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)

    0 讨论(0)
  • 2021-02-04 01:37

    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

    0 讨论(0)
  • 2021-02-04 01:41

    remove the hidden folder named .git from your Desktop

    0 讨论(0)
提交回复
热议问题