git commit历史提交

GitHub热度图的365天中漏掉一天,想要补签卡? git commit --date了解一下

使用git自定义时间的提交格式:

1
git commit --date="月 日 时间 年 +0800" -am "提交"

-am 会执行add 和 merge 这两个命令

比如十天前的推送

git可以读懂人类语言!

1
git commit --date="10 day ago" -m "Your commit message" 

如果我要把日期修改为 1999.9.9那么我可以使用下面代码

1
git commit --date="sep 9 9:00:00 1999 +0800" -am "commit"

创建空提交

1
2
3
git commit --amend --no-edit --date="Fri Nov 6 20:00:00 2015 -0600" 
git commit --amend --no-edit --date="星期几 月 日 20:00:00 年份 时区"
tips:+0800北京时间

月份缩写

1
2
3
4
5
6
7
8
9
10
11
12
January, Jan.
February, Feb.
March, Mar.
April, Apr.
May, May.
June, Jun.
July, Jul.
August, Aug.
September, Sep.
October, Oct.
November, Nov.
December, Dec.

本文参考:

https://stackoverflow.com/questions/3895453/how-do-i-make-a-git-commit-in-the-past

https://stackoverflow.com/questions/23609991/git-github-commit-at-past-date/34639957#34639957

https://git-scm.com/docs/git-commit/2.24.0


git commit历史提交
https://siggraph.pages.dev/post/2022/git-commit/
作者
SigUltra
发布于
2022年9月27日
许可协议