rewrite-hours
Move existing commit times into chosen daily working hours.
Usage
git-wrangler rewrite-hours --window <schedule> [options]Warning: This rewrites Git history. Coordinate with collaborators and use
git-wrangler push --forcewhen publishing the result.
Quick start
git-wrangler rewrite-hours --window 09:00-17:00
What it does
rewrite-hours keeps each selected commit on its current calendar date while moving its author and committer time into a chosen same-day window.
Use one window for every day, or provide a weekday schedule. With a schedule, commits on omitted weekdays stay unchanged.
Window formats
# Every day
git-wrangler rewrite-hours --window 09:00-17:00
# Weekdays and Saturday; Sunday stays unchanged
git-wrangler rewrite-hours \
--window mon-fri=09:00-17:00,sat=10:00-14:00
Each start time must be earlier than its end time.
Options
| Option | Default | What it does |
|---|---|---|
--window <schedule> |
Required | Set one daily window or a weekday schedule. |
--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. |
--repo <path> |
Whole workspace | Rewrite exactly one repository. |
--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 only commits currently dated in 2025
git-wrangler rewrite-hours \
--window mon-fri=09:00-17:00 \
--rewrite-after 2025-01-01 \
--rewrite-before 2026-01-01
# Target one repository while offline
git-wrangler rewrite-hours \
--repo ./api \
--no-fetch \
--window 14:00-17:00
Before you run it
git-filter-repo is required. Git Wrangler records changed commits so rollback-rewrites can restore them later.
Related commands
- Use
rewrite-dateswhen calendar dates should change too.