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

5 lines
211 B
Plaintext
Raw Normal View History

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