Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git through Visual Studio Code is unusably slow

I currently have an issue that I can't properly pin down at the moment.

When I try to use Git through Visual Studio Code, either through starting a Git Bash terminal or using the GUI tools it takes a monumental amount of time to actually run the commands.

It seems to be random, but as an example when running, "git push -u origin main" it has taken anywhere from 2:37 minutes up to 17:03 minutes:

An example just run now

In comparison, when I run the exact same command on the exact same folder, but instead through the stand-alone Git Bash it takes about 2 seconds to run.


Thus,

  • Why would it be running this slow?
  • And is there any way I could check what it is doing when running those commands (so I can figure out why it is running that slow)

2022-06-04

I have tested this on another computer in our environment and then on my personal computer. There were zero issues on the personal, but the computers in my work environment are still running Git commands through Visual Studio Code very slowly.

So as I assumed, it is most likely an issue related to something in our environment (but not network related). But I still wish to know why is it taking such a long time or How can I figure this information out myself?

  • My issue was resolved by doing the Trace and seeing the credential manager core was my issue. I reinstalled Git without the Credential Manager
  • I do not know why the credential manager had issue on my machine. But my environment is heavily restricted, so I imagine it is related to that
  • I recommend trying the same commands in the Git Bash (not through Visual Studio Code). Then, confirming the slowness is unique to Visual Studio Code. Run the trace as given in the answer, find the line that is taking the long time and go from there.
like image 470
Mi-krater Avatar asked Aug 30 '25 15:08

Mi-krater


2 Answers

It's a bug from a recent update. As a workaround, you can disable "terminal.integrated.shellIntegration.enabled":

  • File > Preferences > Settings, paste terminal.integrated.shellIntegration.enabled in the search bar, then unclick the check box.

or wait for the next update.

like image 173
s0nix Avatar answered Oct 14 '25 02:10

s0nix


why is it taking such a long time or How can I figure this information out myself?

One possibility is to activate, in your VSCode Git bash session, GIT_TRACE2 flags, that you can see listed here.

At least:

export GIT_TRACE2_PERF=1
# your git commands
like image 23
VonC Avatar answered Oct 14 '25 03:10

VonC