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

5 lines
205 B
Plaintext
Raw Normal View History

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