Git 查看n行到m行代码历史变化
滿天的星座
滿天的星座 2017-05-02 09:46:42
[Git讨论组]

Git 仓库里有5000次提交,每次提交都对文件名为

  chuxiandi_file

做了修改。

  PS:chuxiandi_file 可以翻译成“出现帝”。

其中,chuxiandi_file中有一个function 名为

  xianshijing_function

其中,xianshijing_function 占据50行--100行。
当然,xianshijing_function 虽然不可能在每次提交中都被修改了,但是确实在很多次commit中被修改了。

  PS: xianshijing_function 可以翻译成“现世精”

那么问题来了,git 能不能实现只查看xianshijing_function在5000次commit中变化的情况?

滿天的星座
滿天的星座

全部回复(1)
phpcn_u1582
man git-log

里边有写:

−L <start>,<end>:<file>, −L :<funcname>:<file>

Trace the evolution of the line range given by "<start>,<end>" (or the function name regex <funcname>) within the <file>. You may not give any pathspec limiters. This is currently limited to a walk starting from a single revision, i.e., you may only give zero or one positive revision arguments. You can specify this option more than once.

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号