Timetravel through your Git history Backdate your commits, merges, tags, cherry-picks and more β safely, consistently, and with style.
π§ gat
is a flexible and extensible toolkit
for applying custom dates to Git-native operations.
With full support for relative/absolute/human-friendly dates, seamless Git integration, and a clear modular structure, it lets you:
- π³οΈ Write history like a time traveler
- π§½ Clean up messy timelines
- π Simulate workflows for testing, demos, and storytelling
curl -s https://raw.githubusercontent.com/siguici/gat/main/install.sh | bash
Installs
gat
into~/.local/bin
(or globally if run withsudo
).
git clone https://github.com/siguici/gat.git
cd gat
./install.sh
gat
wraps your existing Git commands while allowing you to:
- Specify the date in flexible formats
- Use natural aliases (like
yesterday
,last week
,-2d
,+1d
) - Apply dates to commits, merges, tags, cherry-picks, and more
- Keep your current time (or override it)
No history rewriting. No rebase shenanigans. Just scoped, intentional backdating.
gat <date> <git-subcommand> [options]
# Commit with ye
8000
sterday's date and current time
gat yesterday commit -am "Fix for Monday"
# Commit from 3 days ago
gat -3d commit -m "Old feature work"
# Merge a branch with custom date
gat 2024-03-21 merge feature-branch
# Tag with relative date
gat -1d tag v1.0.1 -m "Hotfix release"
# Cherry-pick a commit with date override
gat -2d cherry-pick abc123
Format | Meaning | Examples |
---|---|---|
-1d , +3d |
Relative day offset | -2d (2 days ago) |
0 |
Today | gat 0 commit ... |
yesterday |
Shortcut for -1d |
gat yesterday ... |
tomorrow |
Shortcut for +1d |
gat tomorrow ... |
YYYY-MM-DD |
Absolute date | gat 2023-12-31 ... |
now |
Use current date & time | gat now ... |
--time |
Time override (HH:MM[:SS]) | --time 14:30 |
- If no
--time
is passed: uses current time - All Git commands supported:
commit
,merge
,tag
,cherry-pick
, etc. - Aliases auto-recognized:
-1
,-1d
,yesterday
are equivalent
Command | Description |
---|---|
commit |
Date-aware commit |
merge |
Merge with custom date |
tag |
Annotated tag with date |
cherry-pick |
Cherry-pick commit with new date |
revert |
Revert commit with specified date |
Option | Description |
---|---|
--time |
Set a custom time (e.g., --time 08:30 ) |
--debug |
Show resolved date/time |
--dry-run |
Print command but donβt execute |
--no-color |
Disable colored output (CI-friendly) |
gat/
βββ bin/
β βββ gat # Git CLI interface
β βββ utils.sh # Shared shell logic
βββ install.sh # One-liner installer
βββ tests/ # Integration tests
βββ README.md # This file
βββ LICENSE # MIT License
gat 2023-12-25 commit -am "π Christmas commit"
gat yesterday tag v1.2.3 -m "Hotfix pushed"
gat 2024-03-01 merge feature --no-ff --time 10:45
gat -2d commit -am "Check this" --dry-run
MIT License - Open source and free to use.
Crafted with care by @siguici
- β Star the repo
- π Report bugs
- π‘ Suggest features
- π PRs welcome!
"History is written by the victors. Git history is written by you." β
gat