git-redate
Skill3 starsChanged 2 months agoMITView on GitHub
Rewrite Git commit timestamps. Use when the user wants to change, move, or fix the date/time of specific commits — including moving weekend commits to weekdays, setting a commit to a particular date, or adjusting multiple commit dates at once.
- Deletes or force-pushes
- Commits and pushes
In this repository17 other files it gives its agents.
- config/AGENTS.mdAGENTS.md
- analyzeSkill
- app-resizabilitySkill
- code-reviewSkill
- device-interactionSkill
- figmaSkill
- git-commitSkill
- gitlab-glabSkill
- jira-task-contextSkill
- jira-updateSkill
- mr-comment-resolutionSkill
- pragmatic-testingSkill
- resolve-merge-conflictsSkill
- swift-concurrencySkill
- tddSkill
- verifySkill
- xcodebuild-xcsiftSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 71
Run auto dry-run to show what will change:
- Distinctive: line 76
If the user explicitly requested this rewrite and the dry-run matches the requested scope, apply without asking again.
- Distinctive: line 93
Run dry-run and present the planned changes:
- Very specific: line 100
If the request already specified the commits and target dates and the dry-run matches it, apply without another confirmation.
- Distinctive: line 104
Always verify the result:
- Distinctive: line 148
If only a date is given, the commit's original time is preserved.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
git-redate
Rewrite author and committer timestamps for one or more commits using
git rebase -i with an injected GIT_SEQUENCE_EDITOR. No external plugins required.
⚠️ This rewrites commit history. Safe for unpushed commits. For already-pushed commits a
git push --force-with-leasewill be needed afterward.
Script
./scripts/redate.pyResolve against the skill directory:
~/.pi/agent/skills/git-redate/scripts/redate.py
Modes
Auto mode — move all weekend commits in a range
Scans a commit range, finds Saturday/Sunday commits, moves them to Monday or Friday.
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py [--range RANGE] [--move-to monday|friday] [--dry-run]| Option | Default | Description |
--range RANGE | @{u}..HEAD | Range to scan — default is all unpushed commits |
--move-to monday|friday | monday | Where to move Saturday/Sunday commits |
--dry-run | — | Preview without touching history |
Manual mode — set specific commits to specific dates
Explicitly name which commits to rewrite and to what date/time. Repeatable.
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --set HASH DATE [--set HASH2 DATE2 ...] [--dry-run]| Argument | Description |
HASH | Full or short commit hash (e.g. a1b2c3d) |
DATE | Target date/time — see formats below |
DATE formats:
| Format | Example | Time behaviour |
YYYY-MM-DD | 2025-01-20 | Preserves original time of day |
YYYY-MM-DDTHH:MM | 2025-01-20T14:30 | Sets exact time |
YYYY-MM-DDTHH:MM:SS | 2025-01-20T14:30:00 | Sets exact time |
YYYY-MM-DD HH:MM | 2025-01-20 14:30 | Sets exact time |
Agent workflow
For "move weekend commits" requests
- Run auto dry-run to show what will change:
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --dry-run - Present the output to the user.
- If the user explicitly requested this rewrite and the dry-run matches the requested scope, apply without asking again. Otherwise ask for authorization before applying:
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py
For "change specific commits" requests
- Show the user recent commits so they can identify which ones to change:
git log --format="%h %ad %s" --date=format:"%a %Y-%m-%d %H:%M" -n 20 - Understand the user's intent — e.g.:
- "change
a1b2c3dto last Wednesday" - "move these two commits to Monday morning"
- "set commit
deadbeefto 2025-01-15 at 10:00"
- "change
- Resolve natural-language dates to concrete
YYYY-MM-DDorYYYY-MM-DDTHH:MMvalues using the current date as reference. - Run dry-run and present the planned changes:
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py \ --set a1b2c3d 2025-01-15 \ --set deadbeef 2025-01-15T10:00 \ --dry-run - If the request already specified the commits and target dates and the dry-run matches it, apply without another confirmation. Otherwise ask the user to authorize the concrete dry-run plan before applying without
--dry-run.
After applying
Always verify the result:
git log --format="%h %ad %s" --date=format:"%a %Y-%m-%d %H:%M" -n 20Example invocations
# Auto: preview all unpushed weekend commits
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --dry-run
# Auto: move unpushed weekend commits to Monday
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py
# Auto: move to Friday, custom range
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --range main..HEAD --move-to friday
# Manual: move one commit to a specific date (preserves original time)
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --set a1b2c3d 2025-01-20
# Manual: move one commit to a specific date and time
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --set a1b2c3d 2025-01-20T10:30
# Manual: rewrite multiple commits at once
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py \
--set a1b2c3d 2025-01-20 \
--set b2c3d4e 2025-01-21T09:00 \
--set c3d4e5f 2025-01-22
# Manual: dry-run first
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py \
--set a1b2c3d 2025-01-20 \
--dry-runHow it works
- Auto mode:
git logcollects commits in the range. Weekend commits get their timestamps shifted ±1–2 days (time of day preserved). - Manual mode: each
--set HASH DATEpair is resolved viagit rev-parse. If only a date is given, the commit's original time is preserved. The rebase base is computed automatically from the oldest targeted commit. - A temporary
GIT_SEQUENCE_EDITORscript is generated that injectsexec env GIT_COMMITTER_DATE='...' git commit --amend --no-edit --date='...'after the relevantpicklines in the rebase todo. (--datesets author date;GIT_COMMITTER_DATEsets committer date.) git rebase -i <base>runs with that editor. The script has its own confirmation prompt; answer it affirmatively only when the rewrite is authorized under the global policy.- Temp files are cleaned up automatically.
Troubleshooting
| Problem | Fix |
fatal: no upstream configured | Pass --range HEAD~N..HEAD explicitly |
| Rebase fails mid-way | Run git rebase --abort to restore |
| Uncommitted changes | Stop and ask the user to commit/discard them or explicitly request a stash; never stash automatically |
| Already-pushed commits | Report that git push --force-with-lease will be required; never force-push unless the user explicitly requests it |
| Commit not in branch history | Make sure you are on the correct branch |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

