Git Change Tracker for VS Code
This extension helps you track Git changes in your codebase and automatically generates commit messages and descriptions using AI (ChatGPT-4o).
Features
- Track Git Changes: Monitor and retain a list of changes before committing
- File Selection: Select specific files to include in your change tracking and summaries
- AI-Powered Summaries: Use OpenAI's GPT-4o to analyze changes and generate concise, meaningful commit messages
- Auto-Paste into Git Commit: Automatically insert generated summaries into VS Code's Git commit message area
- Optional Text File Generation: Generate a text file with the summary and description for your records
- Export Commit History: Export your Git commit history to a text file for reference and documentation
- Multi-Repository Support: Work with multiple Git repositories in the same workspace
Requirements
- VS Code 1.60.0 or higher
- A Git repository
- An OpenAI API key with access to the GPT-4o model
Installation
You can install this extension via the VS Code Marketplace:
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X)
- Search for "Git Change Tracker"
- Click Install
Manual Installation
If you prefer to install manually:
- Download the
.vsix
file from the releases page
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X)
- Click the "..." menu in the top-right of the Extensions view
- Select "Install from VSIX..." and choose the downloaded file
Setup
Before using the extension, you need to configure your OpenAI API key:
- Go to File > Preferences > Settings
- Search for "Git Change Tracker"
- Enter your OpenAI API key in the "GitChangeTracker: OpenAI API Key" field
Usage
- Make changes to your repository files
- Run the "Track Git Changes" command
- Press Ctrl+Shift+P and type "Track Git Changes"
- This will display a selection checklist where you can choose which files to include
- By default, all changed files are selected
- Confirm your selection to track the changes
- Run the "Generate Change Summary" command
- Press Ctrl+Shift+P and type "Generate Change Summary"
- This will analyze all tracked changes (without file selection) and generate a summary
- The summary will automatically be inserted into the Git commit message
- Alternatively, run the "Generate Change Summary (With File Selection)" command
- This combines tracking with file selection and summary generation in one step
- You'll be presented with a checklist to select which files to include
- For pull requests, you can run "Insert PR Description" command
- This will copy the detailed description to your clipboard
- Paste it into the pull request description field
- To export your Git commit history to a text file:
- Press Alt+Shift+S or run the "Export Git Commit History" command
- This will create a file named
git_commit_history.txt
in your workspace root
- The file will contain a formatted history of all commits in the repository
- The file will automatically open in the editor after it's created
Working with Multiple Repositories
If your workspace contains multiple Git repositories:
- The extension will automatically detect all Git repositories in your workspace
- If only one repository exists, it will be selected automatically
- If multiple repositories exist, you'll be prompted to select which one to use the first time you run a Git-related command
- The selected repository will be remembered for subsequent operations in your session
- If you need to switch repositories, simply restart VS Code and select the new repository on your next command
Keyboard Shortcuts
For faster workflow, the extension provides the following keyboard shortcuts:
Command |
Keyboard Shortcut |
Description |
Track Git Changes |
Alt+Shift+T |
Scans and records Git changes with file selection |
Generate Change Summary |
Alt+Shift+G |
Analyzes all changes and generates a commit message with AI |
Generate Change Summary (With File Selection) |
Alt+Shift+X |
Lets you select files and then generates a commit message for the selected files |
Insert PR Description |
Alt+Shift+P |
Copies the previously generated description to clipboard for pasting into a pull request |
Export Git Commit History |
Alt+Shift+S |
Exports formatted Git commit history to a text file in the workspace root |
These shortcuts work in the editor, sidebar, and terminal. You can customize them in VS Code's Keyboard Shortcuts settings.
Configuration Options
OpenAI API Key (ewsGitChangeTracker.openaiApiKey
): Your API key for accessing the OpenAI API. Required for generating summaries.
Generate Text File (ewsGitChangeTracker.generateTextFile
): When enabled, saves a formatted text file (ews-commit-summary.txt
) with both the summary and detailed description in your workspace. Useful for preserving the detailed analysis or for copying into pull request descriptions.
Enable Commit Log (ewsGitChangeTracker.enableCommitLog
): Maintains a history log of all generated summaries and descriptions in ews-git-change-tracker-log.txt
. Each entry is timestamped for easy reference. Enabled by default.
You can configure these settings through:
- VS Code Settings UI (File > Preferences > Settings, search for "EWS Git Change Tracker")
- Directly in your
settings.json
file
- Workspace settings for project-specific configurations
Troubleshooting
No Changes Detected
Make sure you have uncommitted changes in your Git repository. You can verify this by checking the Source Control panel in VS Code.
Repository Selection Issues
If you're working with multiple repositories and experiencing issues:
- Close and reopen VS Code to reset the repository selection
- Make sure your workspace contains valid Git repositories
- If you have nested Git repositories, the parent repository will be selected by default
OpenAI API Key Error
If you receive an error about the OpenAI API key:
- Verify that you've entered the correct API key in the settings
- Ensure your API key has access to the GPT-4o model
- Check your OpenAI account for any usage limits or restrictions
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- This extension uses the Simple Git library for Git integration
- AI summaries are powered by OpenAI's GPT-4o model
- Developed for Epic Web Studios