a commit git 参数是什么意思_git commit的–date参数的格式是什么

Git 2.6(2015年第3季度)添加一个新选项。

介绍“格式”日期模式

This feeds the format directly to strftime.

Besides being a little more flexible, the main advantage is that your system

strftime may know more about your locale’s preferred format (e.g., how to spell the days of the week).

--date=format:...

feeds the format ... to your system strftime.

Use --date=format:%c to show the date in your system locale’s preferred format.

See the strftime manual for a complete list of format placeholders.

原始答案(2014年中期)

–date选项(在2009年12月的commit 02b47cd中为git1.7.0引入)使用与GIT_AUTHOR_DATE相同的格式,日期格式在commit 96b2d4f中测试:

在那里你可以看到接受的各种格式:

> rfc2822:Mon,3 Jul 2006 17:18:43 0200

> iso8601:2006-07-03 17:18:43 0200

> local:Mon Jul 3 15:18:43 2006

> short:2006-07-03(不是在1.9.1,工程在2.3.0)

> relative:see commit 34dc6e7:

5.seconds.ago,

2.years.3.months.ago,

'6am yesterday'

> raw:see commit 7dff9b3(git 1.6.2,2009年3月)

内部原始git格式 – 自纪元以来的时间加上时区

(换句话说:“date”%s%z“’format)

> default:Mon Jul 3 17:18:43 2006 0200

Does it accept 2006-07-03 15:18:43 for local?

Yes it does work and it takes the local time zone automatically.

With that format I don’t need to bother which day of the week it is (Sun, Mon, etc).

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值