Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accidentally tracked my entire desktop to a git repo

Tags:

git

...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. :(

like image 931
Brian Zhou Avatar asked Dec 21 '25 09:12

Brian Zhou


1 Answers

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.

like image 191
Alvin S. Lee Avatar answered Dec 24 '25 01:12

Alvin S. Lee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!