Git Time Machine ⏰
Safely edit commit messages and timestamps for unpushed commits
📖 What is Git Time Machine?
Git Time Machine is a powerful VS Code extension that allows you to safely edit commit messages and timestamps for commits that haven't been pushed to a remote repository. Whether you need to fix a typo, update commit dates, or clean up your commit history before pushing, Git Time Machine makes it easy and safe.
🎯 Why Git Time Machine?
- ✅ Safety First: Only allows editing unpushed commits
- ✅ Automatic Detection: Scans and identifies unpushed commits automatically
- ✅ Beautiful UI: Modern webview interface with Tailwind CSS and smooth animations
- ✅ Bulk Editing: Edit multiple commits at once
- ✅ Visual Date Picker: Flatpickr integration for easy timestamp selection
- ✅ Backup Branch: Automatically creates backup before making changes
- ✅ Undo Support: Easily restore from backup if needed
- ✅ Dark & Light Themes: Matches your VS Code theme
🎬 Demo
Note: Demo GIF coming soon! The extension is fully functional.
Screenshot Placeholders:
Main View - Unpushed Commits
Date/Time Picker Webview
Bulk Edit Summary
✨ Features
🔍 Automatic Unpushed Commit Detection
- Automatically detects commits that haven't been pushed to remote
- Displays them in a dedicated tree view in the Source Control panel
- Shows commit hash, author, message, and relative time
- Works with branches that have remote tracking or standalone branches
✏️ Edit Commit Messages
- Edit commit messages with a simple input box
- Validation to prevent empty messages
- Works for HEAD and older commits
📅 Edit Commit Timestamps
- Visual date/time picker with calendar interface
- Separate controls for Author Date and Commit Date
- Sync button to match dates easily
- Supports multiple date formats
📦 Bulk Edit Multiple Commits
- Select multiple commits using multi-select QuickPick
- Edit each commit's message and timestamp in sequence
- Beautiful summary table before applying changes
- Progress indicators during processing
🛡️ Safety Features
- Remote Check: Automatically verifies commits aren't on remote
- Backup Branch: Creates backup branch before any changes
- Undo Command: Restore from backup with one command
- Working Tree Check: Warns about uncommitted changes
- Confirmation Dialogs: Always confirms before making changes
🎨 Beautiful UI
- Modern Tailwind CSS styling
- Smooth fade and slide animations
- Responsive design
- Dark and light theme support
- Heroicons integration
- Progress animations
📊 Tree View Integration
- Integrated into VS Code's Source Control panel
- Shows all unpushed commits at a glance
- Inline edit buttons for quick access
- Auto-refresh on git changes
- Tooltips with full commit details
📦 Installation
From VS Code Marketplace
- Open VS Code
- Press
Ctrl+Shift+X (or Cmd+Shift+X on Mac) to open Extensions
- Search for "Git Time Machine"
- Click Install
- Reload VS Code if prompted
From VSIX File
- Download the
.vsix file from releases
- Open VS Code
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type "Extensions: Install from VSIX"
- Select the downloaded
.vsix file
From Source
git clone https://github.com/DilZhaan/git-time-machine.git
cd git-time-machine
npm install
npm run compile
# Press F5 to launch Extension Development Host
🚀 Usage
Method 1: Quick Edit from Tree View
- Open a git repository in VS Code
- Open the Source Control panel (
Ctrl+Shift+G / Cmd+Shift+G)
- Look for the Git Time Machine section
- Click the ✏️ edit icon next to any commit
- Choose what to edit (message, timestamp, or both)
- Follow the prompts
Method 2: Single Commit Edit (Full Flow)
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type: "Git Time Machine: Edit Commit (Full Flow with Webview)"
- Select a commit from the QuickPick
- Choose to edit message and/or timestamp
- Use the visual date/time picker if editing timestamp
- Confirm your changes
Method 3: Bulk Edit Multiple Commits
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type: "Git Time Machine: Bulk Edit Multiple Commits"
- Multi-select commits using the space bar
- For each commit:
- Choose whether to edit message
- Choose whether to edit timestamp
- Use the visual picker for dates
- Review the summary table with all changes
- Confirm to apply all changes at once
Undo Changes
If you need to undo your changes:
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type: "Git Time Machine: Undo Changes (Restore Backup)"
- Select the backup branch to restore
- Confirm the restoration
🎹 Commands
| Command |
Description |
Keyboard Shortcut |
Git Time Machine: Show Unpushed Commits |
Display all unpushed commits from current branch |
- |
Git Time Machine: Edit Commit |
Quick edit from tree view (simple) |
- |
Git Time Machine: Edit Commit (Full Flow with Webview) |
Complete guided flow with visual date/time picker |
- |
Git Time Machine: Bulk Edit Multiple Commits |
Edit multiple commits at once |
- |
Git Time Machine: Undo Changes (Restore Backup) |
Restore from backup branch |
- |
Refresh |
Reload the unpushed commits list |
- |
Custom Keyboard Shortcuts
You can add custom keyboard shortcuts in VS Code:
- Press
Ctrl+K Ctrl+S (or Cmd+K Cmd+S on Mac)
- Search for "Git Time Machine"
- Click the + icon to add a keybinding
Suggested shortcuts:
{
"key": "ctrl+alt+t",
"command": "git-time-machine.showUnpushedCommits"
},
{
"key": "ctrl+alt+e",
"command": "git-time-machine.bulkEdit"
}
📋 Requirements
- VS Code: 1.85.0 or higher
- Git: Installed and available in PATH
- Internet: Required for Tailwind CSS and flatpickr CDN (webview only)
- Repository: A git repository with commits
🛡️ Safety & Security
What Git Time Machine Does
✅ Scans unpushed commits safely
✅ Creates automatic backups before any changes
✅ Validates that commits haven't been pushed
✅ Warns about uncommitted changes
✅ Confirms before making any modifications
What Git Time Machine CANNOT Do
❌ Edit pushed commits (blocked by safety checks)
❌ Delete commits (not supported)
❌ Modify commit content (only metadata)
❌ Force push (you control that)
How It Works
1. Scan → git log <remote>..HEAD
2. Safety Check → git branch -r --contains <commit>
3. Backup → git branch <branch>-gittimemachine-<timestamp>
4. Edit → git commit --amend (for HEAD) or rebase (for older)
5. Undo → git reset --hard <backup-branch>
Best Practices
- ✅ Always work on unpushed commits only
- ✅ Review the summary before confirming changes
- ✅ Keep backup branches until you're satisfied
- ✅ Commit or stash your working changes first
- ✅ Use meaningful commit messages
❓ FAQ
Q: Can I edit commits that have already been pushed?
A: No. Git Time Machine blocks this for safety. Editing pushed commits would rewrite shared history and cause issues for collaborators.
Q: What happens if I make a mistake?
A: Every edit creates a backup branch (e.g., main-gittimemachine-1699376400000). Use the Undo command to restore from any backup.
Q: Does this work with branches that don't have a remote?
A: Yes! If a branch has no remote, all commits are considered "unpushed" and can be edited.
Q: Can I edit multiple commits at once?
A: Yes! Use the Bulk Edit command to select and edit multiple commits in one flow.
Q: Will this affect my collaborators?
A: Only if you force push after editing. As long as you edit unpushed commits, there's no impact.
Q: What's the difference between Author Date and Commit Date?
A:
- Author Date: When the commit was originally created
- Commit Date: When the commit was last modified (e.g., via amend)
In most cases, they're the same. The Sync button keeps them matched.
Q: Does this require internet access?
A: Only for the webview UI (Tailwind CSS and flatpickr are loaded from CDN). The core functionality works offline.
Q: Can I use this in a CI/CD pipeline?
A: Git Time Machine is designed for interactive use in VS Code. For automation, use git commands directly.
Q: How do I delete a backup branch?
A: Use git commands: git branch -D <backup-branch-name> or the VS Code source control UI.
🤝 Contributing
Contributions are welcome! Here's how you can help:
Reporting Bugs
- Check if the issue already exists in Issues
- Create a new issue with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- VS Code version, Git version, OS
- Screenshots if applicable
Suggesting Features
- Open an issue with the
enhancement label
- Describe the feature and use case
- Explain why it would be valuable
Submitting Pull Requests
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Write or update tests if applicable
- Follow the existing code style
- Commit with clear messages:
git commit -m "Add amazing feature"
- Push to your fork:
git push origin feature/amazing-feature
- Open a Pull Request with:
- Clear description of changes
- Reference to related issues
- Screenshots/GIFs if UI changes
Development Setup
# Clone the repo
git clone https://github.com/DilZhaan/git-time-machine.git
cd git-time-machine
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode (auto-compile on changes)
npm run watch
# Launch Extension Development Host
# Press F5 in VS Code
# Run tests
npm test
# Lint code
npm run lint
# Package extension
npm run package
Code Style
- Use TypeScript with strict mode
- Follow ESLint rules
- Add JSDoc comments for public methods
- Use meaningful variable names
- Keep functions focused and small
📝 Changelog
See CHANGELOG.md for a detailed history of changes.
[0.0.1] - 2025-11-07
Added
- Initial release
- Unpushed commit detection
- Single commit editing (message and timestamp)
- Bulk edit multiple commits
- Visual date/time picker with flatpickr
- Backup branch creation
- Undo functionality
- Tree view integration in Source Control panel
- Beautiful webview UI with Tailwind CSS
- Smooth animations and transitions
- Dark and light theme support
- Safety checks for remote commits
- Progress indicators
- Summary table for bulk edits
📄 License
MIT License - see LICENSE file for details.
Copyright (c) 2025 DilZhan YaPa
🙏 Acknowledgments
📞 Support
🌟 Star the Project
If you find Git Time Machine useful, please consider giving it a star on GitHub! It helps others discover the project.
Made with ❤️ by DilZhan YaPa
⏰ Time travel through your git history, safely.