git小技巧:git blame && git show 查看某一行代码的修改历史

先查看某行代码由谁写的,在哪个commit中提交的:

git blame file_name

其显示格式为:
commit ID | 代码提交作者 | 提交时间 | 代码位于文件中的行数 | 实际代码
类似于下面这样

f604879e (yingyinl              2014-09-23 23:39:55 -0700   35) typedef enum
9be6b4bd (yingyinl              2014-01-01 21:22:50 -0800   36) {
597886b5 (Shengjie Yu           2015-09-29 12:00:24 +0800   37)     Index_R_Hue = 0,    //Index_Range0_Hue
9be6b4bd (yingyinl              2014-01-01 21:22:50 -0800   38)     Index_R_Sat,
9be6b4bd (yingyinl              2014-01-01 21:22:50 -0800   39)     Index_R_brt,
9be6b4bd (yingyinl              2014-01-01 21:22:50 -0800   40)     Index_R_Offset,
9be6b4bd (yingyinl              2014-01-01 21:22:50 -0800   41)     Index_R_Gain,
f604879e (yingyinl              2014-09-23 23:39:55 -0700   42) 

这样,我们就可以知道commit ID了,然后使用命令:git show commitID来看

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值