How to show first commit by 'git log'?

后端 未结 6 2047
野趣味
野趣味 2020-11-30 16:50

I have a project which has long history. I want to show the first commit on git.

How do I do this?

6条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 17:51

    git log --format="%h" | tail -1 gives you the commit hash (ie 0dd89fb), which you can feed into other commands, by doing something like

    git diff `git log --format="%h" --after="1 day"| tail -1`..HEAD to view all the commits in the last day.

提交回复
热议问题