Is there a way in git to obtain a push date for a given commit?

后端 未结 8 2030
眼角桃花
眼角桃花 2020-11-27 12:25

I am wondering if there is a way to view a push date associated with each commit in the git log. If that is not possible, is there a way to see all the commits under a cert

8条回答
  •  天命终不由人
    2020-11-27 12:58

    Why git AuthorDate is different from CommitDate?

    • AuthorDate is when the commit was first created.
    • CommitDate is when the commit was last modified (e.g. rebase).

    You can get those with the --pretty formatting options:

           o    %cd: committer date
           o    %cD: committer date, RFC2822 style
           o    %cr: committer date, relative
           o    %ct: committer date, UNIX timestamp
           o    %ci: committer date, ISO 8601 format
    

    So, if you and other developers are doing git rebase before git push, you will end up with a commit date that is later than the author date.

    This command shows the commit date: git log --pretty=fuller

提交回复
热议问题