Skip to content

Imposter/timeshifter

Repository files navigation

Timeshifter

A lightweight Electron app to adjust git commit timestamps. Useful for fixing commit dates after rebasing, correcting clock-related issues, or tidying up your commit history.

Features

  • Load any git repository - Browse and select local git repos
  • View commit history - See all commits with hash, message, author, and dates
  • Three editing modes:
    • Shift - Move selected commits forward or backward by a fixed amount
    • Set Time - Anchor the earliest selected commit to a specific time (preserves relative gaps)
    • Redistribute - Spread commits over a time period (proportional or evenly spaced)
  • Mismatch detection - Automatically detect commits with timestamps out of chronological order
  • Auto-fix mismatches - One-click fix that preserves original time gaps
  • Live preview - See projected changes before applying
  • Repository history - Quick access to recently opened repos
  • Audit history - Track all changes you've made across sessions
  • Theme support - Light, dark, or follow system preference
  • Cross-platform - Works on Windows, macOS, and Linux

Installation

From Source

# Clone the repository
git clone https://github.com/yourusername/timeshifter.git
cd timeshifter

# Install dependencies
npm install

# Run in development mode
npm start

# Or run dev server with hot reload
npm run dev
# Then in another terminal:
npm run electron

Build Executable

# Build Windows installer
npm run dist

# Build portable Windows executable
npm run dist:portable

Built files will be in the release/ folder.

Usage

  1. Load a repository - Click "Load Repository..." and select a git repo folder
  2. Select commits - Click rows or use checkboxes to select commits to modify
  3. Choose an editing mode:
    • Shift: Move all selected commits by the same offset (e.g., +2 hours)
    • Set Time: Set the earliest selected commit to a specific time; others shift to preserve gaps
    • Redistribute: Spread commits over a duration
      • Proportional: Scale to new duration while preserving relative gaps
      • Even spacing: Fixed intervals between commits
  4. Review changes - Pending changes appear at the bottom with old/new dates
  5. Apply - Click "Apply All Changes" to rewrite the commits

Handling Uncommitted Changes

If your repo has uncommitted changes, you'll be prompted to:

  • Stash Changes - Temporarily saves your changes, restores after applying
  • Discard Changes - Permanently deletes uncommitted changes

Time Mismatch Detection

The app automatically detects when commits have timestamps that don't match their order in git history (e.g., a child commit dated before its parent). These are highlighted and can be auto-fixed with one click.

How It Works

Timeshifter uses git filter-branch with --env-filter to rewrite commit timestamps. This modifies:

  • GIT_AUTHOR_DATE - When the code was originally written
  • GIT_COMMITTER_DATE - When the commit was created

Warning: This rewrites git history. If you've already pushed these commits, you'll need to force push (git push --force).

Tech Stack

  • Electron - Desktop app framework
  • React - UI components
  • Vite - Build tool
  • simple-git - Git operations
  • electron-store - Persistent storage
  • electron-builder - Packaging

Requirements

  • Node.js 18+
  • Git installed and available in PATH

License

MIT

About

Rewrite history – adjust your Git commit timestamps effortlessly.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors