git log command ======= ###### tags: `git` :::success 在特定的branch、特定的時間區間,利用git command line,抓出相關的git commit log ::: ```shell= git log master \ --after "2019/10/14" \ --before "2019/10/23" \ --pretty=format:"%h%x09%an%x09%ad%x09%s" \ --date=format:'%Y-%m-%d %H:%M:%S' ``` ![](https://i.imgur.com/Ppjs8qf.png) > refer to [electron/electron](https://github.com/electron/electron) repo ## date range ```shell= --after "2019/10/14" --before "2019/10/23" ``` + **after** = *newer than specific date (not include "2019/10/14")* + **before** = *older than specific date (not include "2019/10/23")* ## pretty format ```shell= --pretty=format:"%h%x09%an%x09%ad%x09%s" ``` + **%h** = *abbreviated commit hash* + **%x09** = *tab (character for code 9)* + **%an** = *author name* + **%ad** = *author date* + **%s** = *subject* ## date format ```shell= --date=format:'%Y-%m-%d %H:%M:%S' ```