简体   繁体   中英

Prevent Git from tracking all of my packages/libraries/modules when I open a new VSCode window

Git slows down my programs & causes my terminal to crash and display this message:

Restarting the terminal because the connection to the shell process was lost...

every time I open a new window in VSCode (ie not a file from an existing repo).

Its almost like its trying to track every file in my computer. Everything runs fine once it caps at 10k pending changes but I want to put a stop to the problem from the source; whatever that may be.

This is the closest issue I could find , it seems like they have the same problem but I'd rather not wait and discard changes every time I open a new window.

This is an example of the kind of files that are being tracked

源代码管理侧边栏的屏幕截图

It seems that the only solution is to sign out every time but this option is worst-case-scenario at the moment.

From here , you can:

  • set "git.autoRepositoryDetection": "openEditors" : a repository will be tracked only if you open a file from it (from issue 53668 ).
  • and/or add a path of a specific repository to git.ignoredRepositories

In your case, only the first option seems practical, as you have too many repositories to "ignore".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM