Git Auto Stage
A VS Code extension that automatically runs git add -u
on every file save, but only if the workspace is a Git repository.
Features
- 🚀 Automatic Staging: Automatically stages modified tracked files when you save
- 🔍 Smart Detection: Only operates in Git repositories to avoid errors
- ⚡ Lightweight: Minimal performance impact on your development workflow
- 🔧 Configurable: Can be enabled/disabled via VS Code settings
- 🛡️ Safe: Silent failures prevent interruption of your save operations
How It Works
When you save a file in VS Code, this extension:
- Checks if the current workspace is a Git repository
- If it is, runs
git add -u
to stage all modified tracked files
- Operates silently without disrupting your workflow
The git add -u
command stages all modifications to files that are already tracked by Git, but doesn't add new untracked files.
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Git Auto Stage"
- Click Install
Configuration
The extension can be configured via VS Code settings:
{
"gitAutoStage.enable": true // Enable/disable automatic staging
}
Requirements
- VS Code 1.60.0 or higher
- Git installed and available in your PATH
- Working in a Git repository
Extension Settings
This extension contributes the following settings:
gitAutoStage.enable
: Enable/disable automatic git staging on file save
Known Issues
None at this time. If you encounter any issues, please report them on our GitHub repository.
Release Notes
1.0.0
Initial release of Git Auto Stage:
- Automatic staging of modified files on save
- Git repository detection
- Configurable enable/disable setting
- Silent error handling
Development
To set up the development environment:
# Clone the repository
git clone https://github.com/your-username/git-auto-stage.git
cd git-auto-stage
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Open in VS Code and press F5 to debug
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.