How do I view all commits for a specific day?

前端 未结 5 1766
天涯浪人
天涯浪人 2020-11-30 17:22

I\'ve already looked at the relevant docs from git-scm.com and gitref.org, but I can\'t seem to figure this out.

Let\'s say I want to get all commits for Tuesday, N

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 17:42

    Nothing wrong with the accepted answer (which I upvoted), but... we're here for science!

    The output below can be expanded/customised with pretty=format: placeholders:

    git log --pretty='format:%H %an %ae %ai' | grep 2013-11-12
    

    Not 100% immune to errors as the same string could have been entered by a user. But acceptable depending on which placeholders are used. The snippet above would not fail, for instance.

    One could as well just parse the whole git log to JSON and consume/manipulate its data to one's heart content. Check https://github.com/dreamyguy/gitlogg out and never look back!

    Disclaimer: that's one of my projects.

提交回复
热议问题