Use future date while making git commits

前端 未结 3 1891
小蘑菇
小蘑菇 2020-12-24 09:00

Is there any easy way to postpone GitHub commits?

It would be also nice if these commits will go one after another in 1 hour.
Let\'s say if I have 5 commits, the

3条回答
  •  不知归路
    2020-12-24 09:44

    You can make commits in any date, time using

    GIT_AUTHOR_DATE='your date' GIT_COMMITTER_DATE='your date' git commit -m 'message'
    

    The format for 'your date' is like Fri May 01 19:32:10 2015 -0400.

    Note that author and committer are different entities in git terminology, and so both the timestamps need to be set (unlike the options provided in other comments and answers).

    In general, the author_date is the one that is picked up by github/in git log etc, and the committer_date is visible when you view all the commit information, like in gitk. If altering the author_date alone works, use the --date option as the other answer points.

提交回复
热议问题