How to find the log I want when using 'git log'

Usually we use the * git log* without any parameters,just like:

git log
##or make the number of the log that need to be show
git log -3

But sometimes I just want to search some specific logs I want.So how can I attach my goal?Add the parameters you need!

  • If you want to search the log with a specific person,using –author:
git log --author=xxx
  • If you want to show the modification history,using -p:
#show the lastest 2 log and the commit modification
git log -p -2
  • If you want to show many logs and just need to know part of the information for every log,using –pretty,the value can be oneline,short,full,fuller,which means the amount of the information you want to display.
#show oneline for every log
git log --pretty=oneline -10
#show part of the log
git log --pretty=short -10
  • show the add/modify/delete file list,using –name-status
  • If you want to show the logs after a time node,using –since or –after:
##show the last 2 weeks' logs
git log --since=2,weeks
  • If you want to show the logs before a time node,using –until or –before:
git log --before=2,weeks
  • If you want to search the key word of the log,using –grep:
git log --grep=xxx
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值