Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entire computer in Git status untracked files

Tags:

git

git-status

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.

like image 746
NICK Avatar asked Dec 27 '15 21:12

NICK


2 Answers

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

like image 181
Armin Braun Avatar answered Oct 11 '22 08:10

Armin Braun


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

like image 23
Shabbir Essaji Avatar answered Oct 11 '22 06:10

Shabbir Essaji