https://github.com/siguici/gat
π§ Git Backdated - A CLI for Git-native operations with custom dates.
https://github.com/siguici/gat
backdated-commits gat git git-backdated
Last synced: about 1 month ago
JSON representation
π§ Git Backdated - A CLI for Git-native operations with custom dates.
- Host: GitHub
- URL: https://github.com/siguici/gat
- Owner: siguici
- License: mit
- Created: 2025-04-14T14:42:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-14T23:36:38.000Z (about 1 year ago)
- Last Synced: 2025-07-19T04:31:51.639Z (11 months ago)
- Topics: backdated-commits, gat, git, git-backdated
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# π°οΈ gat
> **Timetravel through your Git history**
> Backdate your commits, merges, tags, cherry-picks and more β
safely, consistently, and with style.
---
## β¨ Overview
π§ `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
---
## β‘ Installation
### One-liner via `curl`
```bash
curl -s https://raw.githubusercontent.com/siguici/gat/main/install.sh | bash
```
> Installs `gat` into `~/.local/bin` (or globally if run with `sudo`).
### Manual Installation
```bash
git clone https://github.com/siguici/gat.git
cd gat
./install.sh
```
---
## π§ Philosophy
`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.
---
## π¦ Command Syntax
```bash
gat [options]
```
### Example Usages
```bash
# Commit with yesterday'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
```
---
## ποΈ Date Syntax
| 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` |
### π§ Defaults
- 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
---
## β
Supported Git Commands
| 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 |
---
## π οΈ Core Options
| 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) |
---
## π Project Structure
```tree
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
```
---
## π Examples
### Commit with absolute date
```bash
gat 2023-12-25 commit -am "π Christmas commit"
```
### Tag with `yesterday` alias
```bash
gat yesterday tag v1.2.3 -m "Hotfix pushed"
```
### Merge with exact time
```bash
gat 2024-03-01 merge feature --no-ff --time 10:45
```
### Preview command without running
```bash
gat -2d commit -am "Check this" --dry-run
```
---
## π License
[MIT License](./LICENSE.md) - Open source and free to use.
Crafted with care by [@siguici](https://github.com/siguici)
---
## π₯ Contributing
- β Star the repo
- π Report bugs
- π‘ Suggest features
- π PRs welcome!
---
> "History is written by the victors. Git history is written by you." β `gat`