Source Control - 5000 pending changes

I’m afraid files on my computer are at risk. In the past when I first looked at coding, I used Github Desktop and somehow lost all my files on my desktop as they were listed on the repository automatically. Still don’t know what happened.

A few days ago when I published my personal website using Github Desktop I saw the same thing:

Today when working on some code I saw this on VS Code:

I don’t want to do anything with those files. Does anyone know how to disable having these on both VS Code and Github Desktop? It’s nerve-wracking seeing it. Thank you!

If there are files or folders you do not intend to commit to your repository, they need to be listed in a gitignore file.

If u already have those unwanted files on the remote repository, you need to delete them first before adding the gitignore file.

Since there are 144,937 files in the first screenshot is it targeting all files on my computer? Not sure if this is possible, but if so is it normal to put that many (basically my whole computer) in a gitignore file?

I seem to remember you asking this before.

5,000 pending changes isn’t unreasonable for some build systems, but if the number is now 144,000 then something is very wrong.

How did you initialize this repository? If you created it at your filesystem root, then yes you did it wrong. Your repository should only track a single project folder and its subfolders.

I don’t recall how I made it. It may have connected to that automatically. The “current repository” in my first screenshot has a computer icon so I feel it’s connected to all the files on my computer (14k+). For VS Code I’m not sure, but it looks like similar files.

Do you know how I can fix it?

I would delete every single .git folder in your directory since you don’t know what is and is not in your repositories. I would also wipe any remote folders that contain sensitive files.

I would then follow a tutorial on how to set up a Git repository. Something like this:

If you don’t carefully pay attention to tutorials, this is one area where you can expose your private data very easily. I recommend being careful if you don’t know if or how you added your entire file directory to your repository.

1 Like

Thanks for the link. I can confirm that neither of my repositories contain those files. Do any of these screenshots help find the cause?

Screen Shot 2021-09-01 at 3.32.01 PM

I would like to just get rid of the “Other” section on github desktop

Don’t contain which files? Your repositories must all contain the .git folder. The screenshots don’t really contain any additional information.

For a second I thought you said to delete the repository. I don’t know what delete git folder in directory means, can you explain?

I also don’t use terminal to push code and would rather stick to github desktop for now. I only want to fix the one issue I have which is seeing 140k files under arshia in my last screeenshot. Perhaps I can just disconnect this
Screen Shot 2021-09-01 at 6.16.06 PM

If you don’t know what the .git folder is, then you didn’t read the tutorial I linked. I can’t explain it better than you will find in that tutorial or other tutorials you can find on Google.

None of my repositories on contain the .git folder that is showing 140k files. Am I missing something?

I read the entire article, which was great, but it didn’t help me find a solution to how to remove changes I shared in my screenshots of github desktop or vs code.

Should I just click remove on this and maybe it will resolve the github desktop issue at least? I don’t want to do anything with those 140k files (which is now 150k btw…)
Screen Shot 2021-09-02 at 4.38.25 PM

I mean, you could just try things and see what happens.

Have you tried to actually determine what are in those 140k files that are being changed? It should be really easy to determine if your entire filesystem is in a repository by visual inspection.

I thought that tutorial had the .git folder but it seems that it is not. It’s mentioned in many freeCodeCamp articles. This is another tutorial that actually talks about the .git folder.

Is there a chance clicking “remove…” can effect the files on my system? I know probably not, but just making sure.

Are you asking if I’ve “visually” seen my entire file system in a repository? If so then no which is why I shared the screenshot of my repository on github.

Sharing random screenshots is not useful, no.

I have no idea what that button does since I don’t use GitHub Desktop. You could try reading their documentation on what that button does. Google is your friend.

Found the solution. Writing this for reference for someone reading this in the future on a mac :

  1. Click remove on the repository (it wont delete anything on the computer)
  2. Enter defaults write AppleShowAllFiles 1 && killall Finder in terminal to display hidden files (for me it was in my hard drive → users → my user account as I showed in my screenshots)
  3. Delete .git folder
  4. Repeat step 2 to hide hidden folders back to normal

FWIW, I see no reason to keep ‘hidden’ folders and files hidden. Configuration and other settings files frequently have a dot preappended, but they are often just human readable text files that can be informative and useful to peak into or edit.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.