rewrite-dates
Redistribute existing commits across a realistic date range.
Usage
git-wrangler rewrite-dates [options]Warning: This rewrites Git history. Coordinate with collaborators and use
git-wrangler push --forcewhen publishing the result.
Quick start
git-wrangler rewrite-dates \
--start-date 2025-01-01 \
--end-date 2025-12-31
What it does
rewrite-dates moves selected commits onto one shared activity calendar across the workspace. It keeps commit order valid, creates active and rest days, previews the plan, and asks once before applying it.
Only selected commits move. Existing commits outside the selection remain fixed, so an impossible requested range is rejected before anything changes.
Choose the target range
- Use
--start-dateand--end-datefor a fixed calendar range. - Use
--days <number>for the most recent number of days, ending today or on--until. - Omit the target range to infer it from the selected commits.
--days cannot be combined with --start-date or --end-date.
Control the pattern
--frequency low|medium|highcontrols how many days contain activity.--spread low|medium|highcontrols how even or varied the daily commit counts are.--window 09:00-17:00limits generated times to one daily window.- A schedule such as
mon-fri=09:00-17:00,sat=10:00-14:00sets windows for selected weekdays; omitted days still use generated working hours. --seed <value>reproduces the same plan when the inputs are unchanged.
Options
| Option | Default | What it does |
|---|---|---|
--repo <path> |
Whole workspace | Rewrite exactly one repository. |
--start-date YYYY-MM-DD |
Inferred | Set the earliest target date. |
--end-date YYYY-MM-DD |
Inferred | Set the latest target date. |
--days <number> |
— | Target the latest number of days. |
--until YYYY-MM-DD |
Today | Set the final date used with --days. |
--rewrite-after YYYY-MM-DD |
— | Select commits on or after this current author date. |
--rewrite-before YYYY-MM-DD |
— | Select commits before this current author date. |
--frequency <level> |
medium |
Choose low, medium, or high activity frequency. |
--spread <level> |
medium |
Choose low, medium, or high daily variation. |
--seed <value> |
Generated | Reproduce a plan with a chosen seed. |
--window <schedule> |
Generated hours | Set one daily window or a weekday schedule. |
--no-fetch |
Off | Skip refreshing origin; remote information may be old. |
--yes, -y |
Off | Skip the rewrite confirmation. |
--guided |
Off | Choose options through prompts. |
More examples
# Move commits currently dated in 2024 into the 90 days ending June 1, 2026
git-wrangler rewrite-dates \
--rewrite-after 2024-01-01 \
--rewrite-before 2025-01-01 \
--days 90 \
--until 2026-06-01
# Create a denser, more varied repeatable plan
git-wrangler rewrite-dates \
--frequency high \
--spread high \
--seed team-history-v1
# Use weekday working hours
git-wrangler rewrite-dates --window mon-fri=09:00-17:00
Before you run it
Working trees must be clean and git-filter-repo must be installed. Git Wrangler records changed commits so rollback-rewrites can restore them later.