Hey there! Ever noticed VS Code slowing down because it's constantly scanning for Git repositories? We've got a simple solution: manual control.
💡 What's This All About?
VS Code's Git features are great (especially with the new GitHub Copilot integration!), but there's a catch - it's always scanning your folders for Git repositories. This can:
- 😫 Freeze your files with "file in use" errors
- 🐌 Slow down your workspace
- 🔥 Heat up your CPU
- 🔋 Drain your laptop battery
Our solution? Let you manually open Git repositories when you need them.
🎯 How It Works
Instead of letting VS Code automatically scan everything:
- You decide when to open a Git repository
- Choose your preferred way to open it:
- 📁 Pick from a file browser
- ⚡ Quick-select from your workspace
- ⌨️ Type the path directly
- No background scanning, no slowdowns!
🛠️ Quick Start
- Install this extension
- Use our one-click fix to disable automatic scanning
- Open repositories manually through:
- Command Palette:
Git Scan Fix: Open Repository
- Keyboard Shortcut:
Ctrl+Shift+G O
- Quick Pick from workspace folders
About VS Code's Git Features
VS Code comes with an excellent built-in Git integration that has gotten even better with GitHub Copilot integration:
- ✨ AI-powered commit message suggestions
- 🤖 Smart Git commands and recommendations
- 🔄 Automatic branch management
- 📊 Rich diff viewing and merge conflict resolution
However, there's one significant drawback: continuous repository scanning.
🔍 The Problem with Git Scanning
While VS Code's Git features are powerful, the continuous repository scanning can cause:
- ❌ File-in-use errors blocking your work
- ❌ High CPU usage in large workspaces
- ❌ Disk I/O slowdowns
- ❌ Overall workspace performance degradation
- ❌ Battery drain on laptops
🛠️ How to Control Git Scanning
Method 1: Use Our Quick Fix Commands
- Use
🚀 Fix Git Scanning (Workspace)
for current workspace
- Use
🚀 Fix Git Scanning (Global)
for all workspaces
Method 2: Manual Settings Configuration
Via Settings UI:
- Open Settings (Ctrl/Cmd + ,)
- Search for "git.autoRepository"
- Uncheck "Auto Repository Detection"
Via settings.json:
{
// Disable automatic Git repository detection
"git.autoRepositoryDetection": false,
// Optional: Additional performance tweaks
"git.detectSubmodules": false,
"git.detectSubmodulesLimit": 1,
// Keep Git features enabled
"git.enabled": true
}
Method 3: Workspace-Specific Control
Create or edit .vscode/settings.json
in your workspace:
{
"git.autoRepositoryDetection": false,
"git.detectSubmodules": false
}
Best Practices
- Keep Git Features: Don't disable Git completely, just control the scanning
- Workspace Control: Start with workspace-level settings
- On-Demand Access: Use our commands to open repositories when needed
- Monitor Performance: Watch for improvements after disabling scanning
✨ The Solution
This extension provides:
- 🚀 One-click fix for Git scanning issues
- 📂 On-demand repository access
- 🔧 Simple workspace and global controls
- ⚡ Instant performance improvement
- 🤝 Full compatibility with VS Code Git features
Disabling VS Code's Git Auto Scan
To get the best performance, you can disable VS Code's automatic Git repository scanning:
- Open VS Code Settings (Ctrl+,)
- Search for "git.autoRepositoryDetection"
- Set it to
false
or add this to your settings.json:
{
"git.autoRepositoryDetection": false
}
Additional Git-related settings you might want to adjust:
{
"git.enabled": true, // Keep Git features enabled
"git.autoRepositoryDetection": false, // Disable auto scanning
"git.detectSubmodules": false, // Disable submodule scanning
"git.detectSubmodulesLimit": 1 // Limit submodule depth if enabled
}
Features
- No Background Scanning: Only scans when you explicitly request it
- Multiple Ways to Open Repositories:
- File Picker: Browse and select any repository
- Workspace Quick Pick: Choose from Git repositories in your workspace
- Direct Path Entry: Enter the repository path manually
- Initialize New Repositories: Quick command to initialize Git in current folder
Why Use This Extension?
- Keep VS Code's Git Features: You still get all the great Git and GitHub Copilot features.
- Control When to Scan: Only scan for repositories when you explicitly want to.
- Better Performance: No background processes constantly checking your directories.
- Simple Workflow: Quick commands to open repositories when needed.
- Works Alongside: Use this extension in conjunction with VS Code's built-in Git features for enhanced control and performance.
🛠️ Commands
Git Scan Fix: 🚀 Fix Git Scanning (Workspace)
- Fix scanning issues in current workspace
Git Scan Fix: 🚀 Fix Git Scanning (Global)
- Fix scanning issues for all workspaces
Git Scan Fix: Open Repository (File Picker)
- Browse and open repository
Git Scan Fix: Open Repository (From Workspace)
- Quick pick from workspace
Git Scan Fix: Open Repository (Enter Path)
- Enter repository path
Git Scan Fix: Initialize Repository
- Initialize new Git repository
Usage Tips
- Use keyboard shortcut
Ctrl+Shift+G O
(Cmd+Shift+G O
on Mac) to quickly open repositories
- Use the "Disable Git Auto-Scanning" command to automatically configure VS Code settings
- Use the workspace quick pick for faster access to your project repositories
Manual Git Refresh
When auto-scanning is disabled, you can manually refresh Git status:
- Use the built-in
Git: Refresh
command from the Command Palette
- Click the refresh icon in the Source Control panel
- Use the keyboard shortcut:
- Windows/Linux:
Ctrl+Shift+G R
- Mac:
Cmd+Shift+G R
This gives you full control over when VS Code updates Git status.
After Disabling Auto-Scanning
When you disable automatic Git scanning, you'll need to manually refresh Git status. Here are all your options:
1. Manual Refresh Options
- Use
Git: Refresh
command (Ctrl/Cmd + Shift + G R)
- Click the refresh icon in Source Control panel
- Run
git status
in terminal
2. Alternative Workflows
- Keep auto-scanning enabled for specific important folders
- Use workspace-specific settings instead of global disable
- Set up task automation for periodic Git status updates
3. Best Practices
- Refresh before important Git operations
- Use Source Control panel indicators
- Check status manually when switching branches
- Configure per-folder settings for critical projects
- No continuous background scanning
- Reduced disk I/O
- Lower CPU usage
- Fewer file system locks
- Better overall workspace performance
Contributing
Feel free to file issues and submit PRs on our GitHub repository.
Git Commands Helper
A VS Code extension that provides helpful Git repository management commands.
Features
This extension adds several commands to help manage Git repositories in VS Code:
Git Repository Management
git-commands-helper.initGitRepo
: Initialize a new Git repository
git-commands-helper.openRepository
: Open a Git repository by browsing
git-commands-helper.openRepositoryFromSelection
: Open a Git repository from workspace
git-commands-helper.openRepositoryFromPath
: Open a Git repository from manual path input
git-commands-helper.disableGitScanning
: Disable Git auto-scanning in workspace
git-commands-helper.disableGitScanningGlobally
: Disable Git auto-scanning globally
git-commands-helper.refreshAllRepositories
: Refresh all Git repositories
git-commands-helper.addRepositoriesFromDirectory
: Add all Git repositories from a directory
git-commands-helper.addRepositoriesFromPath
: Add Git repositories from manual path input
git-commands-helper.toggleKeybindings
: Toggle extension keybindings
Default Keybindings
- Initialize Git Repository:
Ctrl+Alt+G I
- Open Repository:
Ctrl+Alt+G O
- Open Repository from Selection:
Ctrl+Alt+G S
- Open Repository from Path:
Ctrl+Alt+G P
- Disable Git Scanning (Workspace):
Ctrl+Alt+G D
- Disable Git Scanning (Global):
Ctrl+Alt+G G
- Refresh All Repositories:
Ctrl+Alt+G R
- Add Repositories from Directory:
Ctrl+Alt+G A
- Add Repositories from Path:
Ctrl+Alt+G M
- Toggle Keybindings:
Ctrl+Alt+G T
Keybindings can be enabled/disabled using the git-commands-helper.toggleKeybindings
command.
Extension Settings
This extension contributes the following settings:
git-commands-helper.enableKeybindings
: Enable/disable keyboard shortcuts (default: true)
Requirements
- Visual Studio Code 1.80.0 or higher
- Git extension for VS Code must be installed
Known Issues
No known issues at this time.
Release Notes
1.0.0
Initial release of Git Commands Helper
- Added Git repository management commands
- Added keybinding support
- Added workspace and global Git scanning controls