码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-12-28 19:19:57      阅读:295      评论:0      收藏:0      [点我收藏+]

标签:小技巧   历史   git   commit   

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

git blame file_name
git blame -L 58,100 KeyboardActivity.java

    其显示格式为: 

    commit ID | 代码提交作者 | 提交时间 | 代码位于文件中的行数 | 实际代码 

    类似于下面这样:

技术分享

技术分享

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

    

本文出自 “梁肖技术中心” 博客,请务必保留此出处http://liangxiao.blog.51cto.com/3626612/1886961

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

标签:小技巧   历史   git   commit   

原文地址:http://liangxiao.blog.51cto.com/3626612/1886961

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!