I have git bash in WIN 10. Since last week suddenly every command (ls, cd, git, ...) runs very slow, even ctrl-c. After type a command it pauses, and then shows result, before command completes, it pauses another while. I remembered last week there was a 3D Graphics GPU something in notification corner during that time. I checked that I don't have GPU in this PC, and it is GeForce 630 with a 2017 driver. (heard that AMD driver can cause such problem).
If you have encountered some Git Bash weird behavior, and shell/terminal works not as fast as before, I'd recommend starting from step 1 or 2
Boot in Safe Mode & see if it helps
Safe Mode disable all non-essential services and other software you might not needPossible results: if Git Bash works faster in this mode, it means 3rd party service or some recently installed software might causes those issues 4 u. Or it could be a bloated git repo/misconfiguration in git config
if this helps you can proceed to step 4 (where I explain how to find which service might be the issue)
Overcomplicated shell prompts might slow down your terminal
🔧 Edit your ~/.bashrc or ~/.bash_profile:
export PS1='\u@\h:\w\$ '
📖 Read more here:
Execute the following commands:
git config --global core.preloadindex true
git config --global core.fscache true
git config --global gc.auto 256
In a nutshell:
core.preloadindex - makes your parallel file operations fastercore.fscache - file system data will be read in bulk and cached in memory for certain operations instead of by file basisgc.auto 256 - make your garbage collection operation more frequent to reduce object bloat (default is 6700)Citation from git help config (this opens a documentation page in your web-browser)
core.preloadIndex Enable parallel index preload for operations like git diff This can speed up operations like git diff and git status, especially on filesystems like NFS that have weak caching semantics and thus relatively high IO latencies. When enabled, Git will do the index comparison to the filesystem data in parallel, allowing overlapping IO’s. Defaults to true.
core.fscache Enable additional caching of file system data for some operations. Git for Windows uses this to bulk-read and cache lstat data of entire directories (instead of doing lstat file by file).
gc.auto When there are approximately more than this many loose objects in the repository, git gc --auto will pack them. Some Porcelain commands use this command to perform a light-weight garbage collection from time to time. The default value is 6700. Setting this to 0 disables not only automatic packing based on the number of loose objects, but also any other heuristic git gc --auto will otherwise use to determine if there’s work to do, such as gc.autoPackLimit.
Verification step:
git config --list
Result should be (if you set all of them):
core.preloadindex=true
core.fscache=true
gc.auto=256
if Step 1 wasn't useful, most likely you can skip this step
msconfig, hit EnterIf it helps:
Many AV tools might slow down not only your PC but other software too such as Git Bash by doing more extra scans during your command execution.
Try adding this files into your exclusion list C:\Program Files\Git\bin\ folder:
git.exessh.exemintty.execonhost.exeSettingsPrivacy & Security => Windows Security => Virus & threat protectionManage Settings => Scroll down to Exclusions.exe files listed above%USERPROFILE%\.gitconfig, %ProgramFiles%\GitGo for default config during installation & avoid PATH overrides
Show hidden files/folders on windows:
File ExplorerFile Explorer click arrow ⬇️ (down to expand the menu) or in Windows 11 it is three vertical dots insteadOptionsViewFiles and Folders, find Hidden files and foldersShow hidden files, folders, and drivesNow hidden you should see all files & folders.
it can useful if you can easily replicate slow terminal
If you still experience this misbehavior
Windows Logs => Applicationgit.exe, bash.exe, mintty.exeYou can find DLLs, conflicts with GPU, permissions issues, antivirus software, or some other useful information.
It is also worth checking Windows logs: - Application logs - System logs
Have a look at the column called Level (Error) after trying to run the commands (that freeze/slows down your git bash). Look at the date and time column to see the most recent errors.
Then Win + R => eventvwr, it is another way to open Event Viewer where you might find warning/error (the one that makes Git Bash or your terminal to freeze)
Error example from Event Viewer (you could use the error message and Event ID to Google the problem):

See How to Stop Windows 10 Apps From Launching at Startup
control panel ➡️ programs and features - find and delete most suspected software you might think of you installed when this freeze/slow terminal appeared.
bash.exeRestore point (⚠️ it can delete some of your data)See Recovery options in Windows
Windows 10 website => Create Windows 10 installation media section.