CLI reference

Command-line reference for git-edit-date — export git commit metadata to CSV, edit dates and author fields, and rewrite branch history.

Requirements

Quick start

git-edit-date export -o commits.csv
# edit author_name, author_email, author_date and committer_date in commits.csv
git-edit-date apply -file=commits.csv
git push --force-with-lease

Commands

git-edit-date export [-o commits.csv] [-repo path]
git-edit-date apply -file=commits.csv [-repo path] [-allow-dirty]
git-edit-date completion bash|zsh

export

Exports the current branch history to CSV. Only commits reachable from HEAD are included (git rev-list --reverse HEAD).

apply

Rewrites branch history using metadata from the CSV. Requires a clean working tree unless -allow-dirty is passed. Does not change commit messages.

completion

Generates bash or zsh shell completion scripts.

CSV format

"hash","author_name","author_email","author_date","committer_date","message"
"a1b2c3...","Alice","[email protected]","2024-03-06T14:30:00+01:00","2024-03-06T15:00:00+01:00","Initial commit"

Shell completion

Bash (one-time, current shell):

source <(git-edit-date completion bash)

Bash / Zsh (persistent install via Makefile):

make completion-install
# restart shell or: source ~/.bashrc

The .deb package installs completions system-wide for bash and zsh.

Install

curl -LO https://giteditdate.com/git-edit-date_amd64.deb
sudo dpkg -i git-edit-date_amd64.deb

Build from source

git clone https://gitlab.com/somebodysomebodynov/git-date-editor.git
cd git-date-editor
make build
./bin/git-edit-date export -o commits.csv

Package

make package
# -> deb/git-edit-date_<version>_amd64.deb

Install nfpm:

go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest

Warnings

Walkthrough: tutorial · Questions: FAQ · Source: GitLab