How to make git log output that just shows date and hash on one line?

前端 未结 5 1619
时光说笑
时光说笑 2021-01-19 05:59

I need to get the Date and commit results of a set of github in this format:

Date Commit
19 Mar 2015 b6959eafe0df6031485509c539e22eaf2780919c
1 Apr 2015 9a         


        
5条回答
  •  悲&欢浪女
    2021-01-19 06:45

    This would do

    git log -5 --pretty=format:"%ad %H" | awk '{print $3, $2, $5, $7}'
    
    10 Aug 2015 9fb4b1b5e7bcbc7f55e40ceae1758a7288673a51
    10 Aug 2015 3d613862ca53787c97a42e8e2c37e09c8752b637
    7 Aug 2015 727af2863dbe9f7b4da9189bc12f97a99aac5705
    7 Aug 2015 1438b43b5755079bb3e62c819bfef2629d8336e9
    7 Aug 2015 34303c19fb11482d66fc3c1102bc8d8b433af21a
    

提交回复
热议问题