[Solved] VS Code – The git repository has too many active changes, only a subset of Git features will be enabled

I am setting up VS Code to work on an existing Salesforce project saved in BitBucket.

I cloned the repository down to my device and now when I open VS Code I get the message “The git repository at ‘C:Users[my repository directory]’ has too many active changes, only a subset of Git features will be enabled.

When I go to Git in the left hand menu, it says I have 5000 staged changes and it appears to think those changes are that I deleted the files even though I can see them when I go to the file path myself.

Suggestions?

Visual Studio Code details:
Version: 1.42.0 (user setup)
Commit: ae08d5460b5a45169385ff3fd44208f431992451
Date: 2020-02-06T10:51:34.058Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362

Message & Git output

Solution #1:

Check with git ls-files --eol (Git 2.8+) if this is an eol issue.

If yes, then:

  • type git config –global core.autocrlf false
  • re-clone your repository
  • check if the issue persists on VSCode
Respondent: VonC

Solution #2:

My resolution was fortunately straightforward. I accidentally deleted .gitignore when copying a project and once I restored that file the problem was resolved.

Respondent: Andy Gup

Solution #3:

OK it looks like it was something to do with the line breaks! Thank you for your guidance!

I deleted the local files, updated the global configuration settings to set autocrlf to false (and I ended up having to change another global config setting core.longpaths to true as well). Then I re-cloned and it’s all working now!

I’m curious to understand the mechanics here—I’m assuming that the autocrlf setting takes the remote files and edits all the line feeds to make them match the way your OS does line feeds.

So since git had been thinking I deleted all my files (and ls-files returned nothing), does that mean that there was some file that was altered in this way during the clone so git didn’t know where my files were? If so, which file would this have been?

Respondent: rbeachHYP

Solution #4:

The problem is that vs code needs some time if you do a huge amount of change.
This generally happens when you delete or add files manually to the repository.
First of all,

  • Don’t sync before commit.
  • If you see a clock icon on “the source control tab”, just wait. Because you can not commit before that icon gone.
  • If you try to sync then it goes into a loop.

Literally, the solution is waiting until to see the number of changes on the source control tab. Then commit and sync.

Respondent: blackman

Solution #5:

I my case, the issue was solved by changing the way I open VS Code.

When I dragged the project folder into a VS Code window just opened, then the “too many active changes” message appeared, perhaps VS Code interpreted the current project as the previous one charged.

Instead, when I go to the project folder and put “open with” and select VS Code the problem goes away.

Respondent: Mario Andrés

Solution #6:

I was running an external tool that made a lot of changes quickly while I had the project open in CODE and this happened. The only thing that fixed it was re-cloning the entire repository to a new directory.

Respondent: C.M.

Solution #7:

I had the same issue and found a thread with a very straight-forward solution.

The problem was that I cloned a repository and did not have a .gitignore file.

  • I simply added the .gitignore file to the root folder,
  • wrote node_modules into it,
  • saved, and the problem was gone.

Here is the link to the thread: https://forum.freecodecamp.org/t/vs-code-has-5000-files-that-need-to-be-commit/250686/5

Other projects I worked on also have this line in their .gitignore file, so I guess this is a standard. Also, it does make sense, since as developers we do not want to up-and download all node modules to git but use the package.json file to share the information on which modules we need to work on the particular project.

Please try it out and mark this as the correct solution, since other “workarounds” might not solve the issue of a lacking .gitignore file with node_modules in it.

Respondent: MikhailRatner

Solution #8:

The problem has occurred many times for me. The solution is to make sure that you open your project correctly. For example i have a map called backend and into that map i have another map called project(here is my cloned project). When i open vscode i open the map “project” directly instead of “backend”.

Respondent: Jonnie123

Solution #9:

Honestly, by disabling github extension in VSCode will not solve your problem.

**Check the package.json file and see what “dependencies” are causing the overload **

Example
Simply npm uninstall "parcel"
This will allow some of those node-modules to clear up.

**If you still would like to add the node-modules && other large packages simply: **

  1. Create a .gitignore.text or use the new file button
  2. type {enter file name} and it will automatically add all of the children files to .gitignore
  3. git commit -m “” and then you are finished
Respondent: jking026

Solution #10:

You might have DELETED many projects from your current folder, while git didn’t register the deletion.

The simplest solution is to create a new folder and start running VSCode in it.

You can delete the whole old folder, or you can leave it alone. It’s up to you.

Respondent: William Hou

Solution #11:

I solved my similar problem by but exiting out of VS Code and using the command line / terminal to add, commit then push files.

Respondent: Tristanisginger

Solution #12:

Always keep .gitattributes and .gitignore file to avoid such issue

Respondent: Osama

Solution #13:

enter image description here

The workaround for me is to Simply disable the git extension.

Respondent: appdesigns

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.