Context:
We have a Visual Studio project that depends on a nuget package (A Visual Studio thing).
We upgrade our project with that nuget package every time we release a new version of that package.
The project is stored in git and we clone the project to get a local copy so we can start the upgrade from Visual Studio itself through nuget updates.
A colleague complained/noticed that the upgrade would take about 30 or so minutes, and it started off the question of why it was so slow.
After some prodding around, it seemed that when removing git from the root folder and thus essentially untracking all files, the upgrade went 10 minutes faster.
We then all did the same and sure enough it was roughly 10 minutes faster.
As a mitigation we have been copying the project into another folder thus not having git whizzing away in the background, and once the project has finished uploading, we put the project back into the original folder and then git picks up on the changes made in one big hit.
Question:
Is there a way to temporarily disable git from recording changes while the upgrade occurs and then enabling it after the upgrade is done so that it can re-assess the files changed after? My understanding of the situation is that git is probably writing every minor change that occurs while nuget is download and installing the new package to the project.
NB
I write this from an uncertain stand point. Okay, removing git makes it faster, but of course, i am unsure of what really is happening under the hood... so the question may be a bit moot in terms of git. But if we can figure it out, across the company it would save so much time!
To prevent Git from tracking changes in solution temporarily, simply set the Source Control Plug-in to none in Visual Studio via Tools > Options > Source Control > Plug-in Selection:
Note that your solution will be forced to close, you'll need to re-open it.
Once you do, you'll see that Team Explorer isn't tracking changes as Git isn't the currently selected Source Control plug-in: