Entire computer in Git status untracked files

你说的曾经没有我的故事 提交于 2021-02-06 11:32:46

问题


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.


回答1:


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:

  1. move to the home folder

    cd ~
    
  2. delete the git repo

    rm -rf .git
    

    => git repo is gone for sure :)




回答2:


Just Goto C/D or any other drives & run git command 'rm -rf .git'.



来源:https://stackoverflow.com/questions/34484800/entire-computer-in-git-status-untracked-files

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