You press Tab on an empty Git Bash command line and the terminal freezes. Five seconds pass. Ten. Then the prompt comes back. If you've hit this, you're not alone. This Git Bash Tab hang shows up constantly in Windows developer setups, and it's almost always the same set of culprits: slow filesystem scanning, VS Code's shell integration interfering with completion, or your repository sitting on a network drive. Fix it in under 30 minutes.
TL;DR
Git Bash Tab hang happens when Bash tries to complete all possible commands and paths on an empty line. Windows filesystem operations are slow. Quick fixes: disable VS Code shell integration, enable Git filesystem cache with 'git config core.fscache true', move your repository to a local drive, or type one character before pressing Tab. Expected success rate: 80-85% with the quick fix tier.
Key Takeaways
- Git Bash Tab hang occurs when completion tries to enumerate all possible commands and paths on Windows, which has slower filesystem caching than Linux
- VS Code's shell integration feature can interact poorly with Git Bash completion; disabling it often solves the issue immediately
- Git filesystem cache (core.fscache) dramatically speeds up repeated completion operations after initial warm-up
- Network and cloud-synced drives (OneDrive, Google Drive, network UNC paths) are major performance bottlenecks for Git operations and completion
- Heavy .bashrc startup scripts can delay completion; keep your shell profile lean for best performance
At a Glance
- Difficulty: Easy
- Time Required: 15-30 mins
- Success Rate: 80-85% of users
What Causes Git Bash Tab Hang?
The Git Bash Tab hang isn't a bug, exactly. It's a performance problem baked into how Bash completion works on Windows. When you press Tab on an empty command line, Bash has no context. So it attempts to complete against every possible command in your PATH, every function in memory, and every file and directory accessible from the current location. On Linux, this is reasonably fast because the OS aggressively caches filesystem metadata. On Windows, it's different.
Windows filesystem operations, especially stat checks (which determine file modification times and attributes), are much slower than on Linux. Git Bash has to repeatedly ask Windows 'does this file exist?' and Windows takes time to answer each question. When you're scanning hundreds of directories across the PATH and the working directory, this adds up fast. Add in Git's own completion scripts, which may enumerate branches, tags, or files in large repositories, and you've got a 3-5 second freeze.
The problem gets worse if your Git repository lives on a network drive, OneDrive, Google Drive, or any cloud-synced location. Network filesystem operations are orders of magnitude slower than local disk. A single stat check can take 100-500ms over the network. Do that 50 times, and you're looking at a 5-25 second hang. That's not uncommon for users working with repositories on cloud storage.
VS Code's shell integration feature, introduced a few years ago, can make this worse. It hooks into the terminal's completion and history system to improve the development experience. But when Git Bash's completion is slow to begin with, shell integration sometimes amplifies the delay or causes completion to hang entirely. Disabling it often solves the problem overnight.
Git Bash Tab Hang Quick Fix
Disable VS Code Shell Integration Easy
- Open VS Code Settings
Press Ctrl+Comma (Windows) to open the Settings panel. - Search for shell integration
Type 'shell integration' in the search box at the top. You'll see 'Terminal: Integrated' and related options. - Toggle off 'Terminal.Integrated.EnablePersistentSessions'
Uncheck the box next to this option. This disables the shell integration feature that hooks into Git Bash's completion system. - Restart the terminal
Close the integrated terminal panel completely (right-click the 'Terminal' tab and select 'Kill Terminal'). Then open a new terminal with Ctrl+Backtick. - Test Tab completion
Press Tab on an empty command line three times. The hang should be gone or nearly gone. If it's still slow, move to the next fix.
Type One Character Before Pressing Tab Easy
- Don't press Tab on an empty line
Instead, type a space or the first letter of the command you want (e.g., 'g' for 'git'). This gives Bash context for completion. - Then press Tab
Bash now completes only the token you've started typing, not every possible command and path on the system. - Verify the response is instant
Completion should happen in under 100ms. If it does, you've solved the problem for everyday use.
More Git Bash Tab Hang Solutions
Enable Git Filesystem Cache Easy
- Open Git Bash
Launch Git Bash and navigate to your repository (the one where Tab hangs most often). - Enable core.fscache
Type:git config core.fscache true
This enables Git's filesystem cache for the current repository. It caches the results of file stat operations so Git doesn't repeatedly ask Windows 'does this file exist?' - Warm up the cache
Rungit statusonce. This forces Git to scan the repository and populate the cache. Wait 10-15 seconds for this to complete. - Test Tab completion
Press Tab on an empty line. You should see a noticeable speed improvement. The first call may take 1-2 seconds (cache warm-up), but subsequent calls should be nearly instant. - Apply to all repositories (optional)
To enable core.fscache globally for every repository you clone or work with, run:git config --global core.fscache true
Move Repository to a Local Drive Medium
- Identify the repository location
In Git Bash, typepwdto print the working directory. Check if the path starts with a drive letter (good: C:/Users/...) or a network path (bad: \server\share or OneDrive paths with 'cloud' indicators). - Open File Explorer and check the path bar
Navigate to the repository folder. If the address bar shows a UNC path (\\), a mapped network drive, or 'OneDrive', 'Google Drive', 'Dropbox', or similar, the repository is on a slow location. - Copy the repository to a local drive
Right-click the repository folder, select 'Copy'. Navigate to C:/ or another local drive (not a thumb drive), right-click, and select 'Paste'. Wait for the copy to finish. This may take several minutes for large repositories. - Update your IDE or shell shortcuts
Update any shell shortcuts, VS Code workspace paths, or IDE project paths to point to the new local location. Delete the old network-based copy once you've verified everything works. - Test Git Bash Tab completion from the local copy
Open Git Bash and navigate to the repository's new local location. Press Tab on an empty line. The hang should be dramatically reduced or gone.
Advanced Git Bash Tab Hang Fixes
Trace and Disable Slow Completion Scripts Advanced
- Open ~/.bashrc in a text editor
In Git Bash, typenano ~/.bashrcto open your shell profile. (If you prefer, you can use any editor:code ~/.bashrcfor VS Code orvim ~/.bashrcfor Vim.) - Add tracing at the top of the file
Go to the very first line. Press Ctrl+Home. Add a new line at the top and type:set -x
This enables command tracing. Every command executed during shell startup or completion will be printed. - Save and exit
Press Ctrl+O, then Enter to save. Press Ctrl+X to exit nano. - Restart Git Bash and trigger the hang
Close Git Bash completely and reopen it. Press Tab on an empty line and wait for the freeze to end. Trace output will scroll past, showing every command executed. Look for repeated calls likegit status,git branch, or directory scans. - Identify the slow operation
Common culprits are git-completion.bash enumerating all branches in a huge repository, or your .bashrc executing network commands during startup. Note which command appears multiple times or takes a long time. - Disable the problematic script
Edit ~/.bashrc again. Find the line that sources git-completion.bash or the slow command. Comment it out by adding#at the start of the line. Save and restart Git Bash. - Remove the tracing line
Once you've identified and fixed the problem, remove theset -xline from ~/.bashrc. This prevents verbose output during normal use. - Test the fix
Press Tab on an empty line. If the hang is gone or significantly reduced, you've successfully identified and removed the bottleneck.
Reduce Git File Stat Checks in Large Repositories Advanced
- Navigate to your large repository in Git Bash
Typegit config core.ignorestatto check if this setting is already enabled. - Enable core.ignorestat
Type:git config core.ignorestat true
This tells Git to skip automatic detection of modified files. Git will no longer ask 'has this file changed?' during operations. This is a trade-off: faster operations, but you must manually stage changes withgit add. - Understand the trade-off
When core.ignorestat is enabled, Git won't automatically refresh its index when a file changes on disk. You must rungit addexplicitly. Use this only on very large repositories where the performance gain is worth the manual effort. - Test Tab completion and git status
Press Tab on an empty line. Rungit status. Both should be much faster. If you find the manual tracking annoying, disable it withgit config core.ignorestat false.
Git Bash Tab hang freezing your workflow? Our remote technicians can disable VS Code shell integration, enable filesystem caching, and trace slow completion scripts in under 15 minutes. Connect now for instant relief.
Get remote helpPreventing Future Git Bash Tab Hang
Once you've fixed the immediate hang, keeping it fixed is about maintenance and smart defaults. Start by enabling core.fscache globally during Git for Windows installation or via git config --global core.fscache true. This single setting prevents the hang from returning for new repositories. Next, keep your .bashrc and .bash_profile lean. Every heavy command (network lookups, large directory scans, spawning slow processes) during shell startup delays completion. Load only what you need at startup; defer the rest to when it's actually called.
Store active development repositories on a local NTFS drive, not OneDrive, Google Drive, or network shares. If you must work with cloud-synced code, sync it to a local folder first and keep the cloud folder out of your Git workflow. The performance difference is dramatic and worth the extra step. If you use VS Code, keep shell integration disabled unless you have a specific reason to enable it. The feature is useful for some workflows, but it's a common source of completion slowdowns in Git Bash.
Disable Git completion scripts you don't use. If you never use Git subcommand completion (you just type full commands), commenting out git-completion.bash in .bashrc eliminates an entire source of slowdown. Similarly, if you work with plain shell scripts and rarely need Bash completion, consider a minimal completion setup. Finally, update Git for Windows regularly. Microsoft pushes performance fixes and filesystem optimizations several times a year, and many of them directly improve Windows filesystem stat performance, which is the root cause of the Tab hang.
Git Bash Tab Hang Summary
Git Bash Tab hang is a Windows filesystem performance issue, not a broken feature. Bash attempts to complete all possible commands and paths when Tab is pressed on an empty line, and Windows stat operations are slow. Fix it by disabling VS Code shell integration, enabling core.fscache to cache filesystem results, moving repositories to local drives, or typing one character before pressing Tab. If none of those work, trace your .bashrc and completion scripts to find the actual bottleneck and remove it. After 15-30 minutes of setup, you'll eliminate the hang entirely and gain a faster, more responsive Git Bash terminal.


