git command tips: Search

1.  Serach author 

git log --author=<pattern> 

git whatchanged  --author="Lake Hu"
commit XXXXXXX(HEAD -> lakedebug)
Author: Lake Hu < >
Date:   Wed Jul 15 13:14:32 2020 +0800

 

 


2.  grep  (grep (search) committed code in the Git history)


[lhu3@zch127bld08 plain-linux]$ git log -G"Debug"
commit ffc28a4e90c4b0bc24a0d8712000ff9e8b8da672 (HEAD )
Author: Lake Hu <>
Date:   Wed Jul 15 13:14:32 2020 +0800

     Add name

 

[lhu3@zch127bld08 plain-linux]$ git diff  ffc28a4e90c4b0bc24a0d8712000ff9e8b8da672^  ffc28a4e90c4b0bc24a0d8712000ff9e8b8da672   |grep Debug
-Print "Debugg 222******  from Lake  \n";
-  TRACE("Debugg  Lake    name : %s",

 

 

$    git grep --break --heading     -n -e   BR2_TOOLCHAIN_HAS_LIBATOMIC     otherbranchname --  filepathname

otherbranchname:buildroot/toolchain/Config.in                                                                                                                                                                                                           
522:config BR2_TOOLCHAIN_HAS_LIBATOMIC                                                                                                                                                                                                      
544:    default y if BR2_TOOLCHAIN_HAS_LIBATOMIC 

 

3.  serach commit message 

 

git  log   --grep  "Debug"

 

commit 9695296b3bd252857e766d63b523e0d5dfa92264
Author: XXXX
Date:   Thu Jul 16 01:41:18 2020 +0200

    Re-compiled  (Debug flavour)

commit 46c0e1ec762b7d9a9c3282edae2771d14c81ef43
Author: HXXX 
Date:   Wed Jun 3 15:04:27 2020 +0800

    Revert "Debug."

    This reverts commit dfc0ac8c039ed1daf663a799be6aa02b441f1104.

commit dfc0ac8c039ed1daf663a799be6aa02b441f1104
Author: HXXXXX
Date:   Wed Jun 3 13:00:29 2020 +0800

    Debug.

commit b1e51c163c984c143a155d974f37b26a6ab02efc
Author: BXCXXX
Date:   Tue May 12 15:02:26 2020 +0800

    Debugging.

commit e3bbaedd0af65223dbf55d3cb1c197faa3a26f8a
Author: EXXXXX
Date:   Mon May 11 10:03:02 2020 +0200

    Debug matching
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值