Reputation: 619
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:
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,
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?
Upvotes: 36
Views: 42093
Reputation: 47
What I did is that I updated my Git Bash installation. Just type this on the Git Bash terminal in the Visual Studio Code:
git update-git-for-windows
Upvotes: 4
Reputation: 453
It's a bug from a recent update. As a workaround, you can disable "terminal.integrated.shellIntegration.enabled"
:
or wait for the next update.
Upvotes: 34
Reputation: 1325137
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
Upvotes: 10