A CLI tool that helps you customize your git commit timestamps. Perfect for maintaining consistent commit histories or backdating commits for project organization.
- 🕐 Custom Timestamps: Set precise commit timestamps with date, time, and timezone
- ⚙️ YAML Configuration: Simple, readable configuration files
- 🔧 Git Integration: Seamlessly works with existing git workflows
- 🌍 Timezone Support: Full timezone support for accurate timestamp management
- ✅ Validation: Built-in validation for git repositories and staged changes
git clone https://github.com/iamsuudi/commitctl.git
cd commitctl
go installDownload the appropriate binary for your system from the Releases page.
commitctl provides several commands to help manage your commit timestamps:
commitctl init
commitctl init --force # Overwrite existing config
commitctl init --interactive # Interactive setupcommitctl commit -m "feat: add amazing new feature"
commitctl commit --dry-run -m "test: preview commit" # Preview onlycommitctl validatecommitctl config preview # Show current config
commitctl config validate # Validate config
commitctl config edit # Edit interactivelycommitctl preview -m "test: preview commit"commitctl help
commitctl --helpFirst, initialize commitctl in your git repository:
commitctl initThis creates a .commitctl/settings.yaml file with default settings:
version: 1
timestamp:
date: 2025-01-01
time:
hour: 0
minute: 0
second: 0
timezone: UTCFor a guided configuration experience:
commitctl init --interactiveThis will prompt you through setting up your timestamp configuration step by step.
Edit .commitctl/settings.yaml to set your desired timestamp:
version: 1
timestamp:
date: 2024-12-25 # Christmas day
time:
hour: 9
minute: 30
second: 0
timezone: America/New_York # Your local timezoneYou can also edit your configuration interactively:
commitctl config editStage your changes as usual, then use commitctl:
git add .
commitctl commit -m "feat: add amazing new feature"commitctl will use the timestamp from your configuration file for both the author and committer dates.
Preview what your commit will look like before executing:
commitctl commit --dry-run -m "feat: add amazing new feature"Or use the dedicated preview command:
commitctl preview -m "feat: add amazing new feature"commitctl config previewcommitctl config validatecommitctl config editValidate your setup before making commits:
commitctl validateThis checks:
- Git repository status
- Configuration file validity
- Git state (staged changes, unmerged paths, etc.)
Add the following to your ~/.bashrc:
source /path/to/commitctl/completion/commitctl.bashAdd the following to your ~/.zshrc:
fpath+=("/path/to/commitctl/completion")
autoload -U compinit && compinitdate: Date in YYYY-MM-DD format (required)time.hour: Hour of the day (0-23, optional, defaults to 0)time.minute: Minute of the hour (0-59, optional, defaults to 0)time.second: Second of the minute (0-59, optional, defaults to 0)timezone: IANA timezone identifier (optional, defaults to UTC)
version: 1
timestamp:
date: 2020-01-01
timezone: UTCversion: 1
timestamp:
date: 2024-12-25
time:
hour: 9
minute: 0
timezone: Europe/LondonIf you want to overwrite an existing configuration:
commitctl init --forcecommitctl supports all IANA timezone identifiers:
version: 1
timestamp:
date: 2024-12-25
time:
hour: 15
minute: 30
timezone: Asia/Tokyocommitctl provides helpful error messages for common issues:
- Not in a git repository
- No staged changes
- Invalid configuration format
- Invalid timezone
- Missing commit message
- Git installed and in PATH
- Go 1.25.5 or later (if building from source)
go build -o commitctlgo test ./...- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Go and the gopkg.in/yaml.v3 library
- Inspired by the need for consistent commit timestamp management