I execute the command git status inside a container of Docker and after more than 6 seconds I get this output.
It took 6.52 seconds to enumerate untracked files. 'status -uno'
may speed it up, but you have to be careful not to forget to add
new files yourself (see 'git help status').
no changes added to commit (use "git add" and/or "git commit -a")
Any solution to make it go faster?
I had the same problem until I allocated more resources Docker by clicking on "Settings" then "Advanced". You'll want to make sure that you're using the latest version of Docker Desktop (for Windows).
By default, the Hyper-V virtual machine in which Docker runs only gets 2 CPUs and 2GB RAM.
Once I bumped up the VM to 3 CPUs and 5GB RAM, I had no problem doing "git status", "git checkout", etc. Before the change, these commands would often never complete.
Before making the change, I went into "Hyper-V Manager" and clicked on the "Memory" tab at the bottom. It showed that "Memory Demand" was about 3GB, so I'm guessing the VM was swapping to disk and that would've caused all kinds of problems. Now, I still have about 2GB of headroom with my RAM, and performance is much much better.
I hope this helps you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With