How can I ignore committing timezone information in my commit?

前端 未结 3 1603
攒了一身酷
攒了一身酷 2020-12-29 06:19

Recently, I forked a repository hosted by github, with contributors spreading all over the world, and found out that the each commit log contains committer\'s timezone infor

3条回答
  •  醉梦人生
    2020-12-29 07:11

    You can use this command to commit in UTC time:

    git commit --date="`date --utc +%Y-%m-%dT%H:%M:%S%z`"
    

    You can also alias it to a convenient name:

    git config --global alias.commitutc '!git commit --date="$(date --utc +%Y-%m-%dT%H:%M:%S%z)"'
    

    And do git commitutc.

    For a more detailed explanation take a look at this blog post.

提交回复
热议问题