Back

git - 高级用法 change commit at , rebase, cherry pick , amend commit

发布时间: 2022-02-15 07:14:00

refer to: https://codewithhugo.com/change-the-date-of-a-git-commit/

# GIT_COMMITTER_DATE="15 Feb 2022 12:19:19" git commit --amend --no-edit --date "15 Feb 2022 12:19:19"

# 注意前面的修改的是commit date, 后面修改的是 author date, 在git中这两个都需要修改,否则push 到远程会不一样。
GIT_COMMITTER_DATE="2 Mar 2022 20:19:19" git commit --amend --no-edit --date "2 Mar 2022 20:19:19 "

下面是效果:

Back