2

...and now it's tracked everything and I can't seem to untrack the files.

I've since deleted the repo in git as well as removed the remote from my local machine. I'm not sure how to safely proceed at this point. When I'm on my desktop and type git status, all contents are being shown.

How do I fix this. :(

Brian Zhou
  • 574
  • 6
  • 15
  • 2
    If you haven't pushed it to other remote repository, the error would only affect your local copy. And if you've removed your local repository, nothing from the mistake should remain. – Alejandro May 03 '18 at 01:32

1 Answers1

8

The comment from Alejandro is correct. Since you have deleted the repo in git and removed the remote from your local machine, then the only machine that is still tracking your desktop is your local machine. So, at least your problem is contained.

To "un-git-ify" your desktop, you simply need to remove the .git folder at the root folder that is being tracked.

To find out the root folder that is being tracked, do git rev-parse --show-toplevel.

Go to that folder. Then, look for a .git sub-folder there. Delete this folder (and all sub-folders) with a command (be careful here!) like rm -rf .git. This will remove git tracking for your folder.

Alvin S. Lee
  • 4,984
  • 30
  • 34
  • @BrianZhou Glad I could help! By the way, if my response did in fact answer your question, please mark it as the accepted answer. I'd appreciate it. Thank you! – Alvin S. Lee May 03 '18 at 05:57
  • hm. I thought I did, but I guess I didn't. I just checked the green checkmark, so hopefully that did it. :) – Brian Zhou May 05 '18 at 15:11
  • Just a tip for Windows Users. The `.git` folder in Desktop may be set as "hide" by default. So you need to config your Windows to “Show Hidden files, folders and drives”. Now you can problably see the .git folder in your Desktop – hugocsl Jan 10 '19 at 11:31