dotfiles/.local/bin/scripts/git-withdate

5 lines
205 B
Bash
Executable File

#!/bin/sh -e
# Execute a git command (usually commit) using the AuthorDate of a given committish
date=$(git log --pretty=format:%at -1 "$1")
GIT_AUTHOR_DATE="$date" GIT_COMMITTER_DATE="$date" git "${@:2}"