V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
? Pro Git
? Atlassian Git Tutorial
? Pro Git 简体中文翻译
? GitX
yazoox
V2EX  ?  git

Git 能够搜索出来这样的 commit 么?改动了某一个或多个指定目录下文件的所 commit

  •  
  •   yazoox · 2021-11-05 09:39:45 +08:00 · 1951 次点击
    这是一个创建于 917 天前的主题,其中的信息可能已经有所发展或是发生改变。

    腾讯云最新优惠活动来了:云产品限时1折,云服务器低至88元/年 ,点击这里立即抢购:9i0i.cn/qcloud,更有2860元代金券免费领取,付款直接抵现金用,点击这里立即领取:9i0i.cn/qcloudquan

    (福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

    root\
      sub1\
      sub2\
        components\
      sub3\
        states\
          core\
      ...
    
    

    我现在想找到所有的 commits ,这些 commits 里面包含有文件在 root\sub2\components\ or root\sub3\states\core\ 下面(在它们的子目录下也算在内)?

    谢谢

    7 条回复  ?  2021-11-06 16:15:25 +08:00
    dinghmcn
        1
    dinghmcn  
       2021-11-05 09:47:00 +08:00
    git log root\sub2\components\
    不行吗? 子目录也算在内
    silenceboychen
        2
    silenceboychen  
       2021-11-05 09:47:21 +08:00
    git log root\sub2\components or git log root\sub3\states\core
    dinghmcn
        3
    dinghmcn  
       2021-11-05 09:51:57 +08:00
    @dinghmcn #1 要同是显示这两个目录可以:
    git log -- root\sub2\components\ root\sub3\states\core\

    git log -h 看看语法,path 可以多个
    shellus
        4
    shellus  
       2021-11-05 09:52:07 +08:00
    IDEA:打开文件或者选择目录的情况下,点击右上角的时钟图标,下方 git 工具栏就是更改了本文件的所有 commit 列表,点击 commit ,或者多选 commit ,右侧出现影响的文件的 diff 列表,双击可查看更改差异

    yyds
    ryncv
        5
    ryncv  
       2021-11-05 09:56:17 +08:00
    推荐一个工具: tig 可以很方便实现你要的效果 直接 tig sub2 就可以
    yazoox
        6
    yazoox  
    OP
       2021-11-05 11:09:41 +08:00
    试了试命令
    git log d07cc202a..HEAD --oneline -- path/to/my-filder
    是可以工作的。
    楼主的工具我也会去试试。
    谢谢!
    risky
        7
    risky  
       2021-11-06 16:15:25 +08:00
    可以试试 git kraken 功能很强
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   6122 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:55 · PVG 09:55 · LAX 18:55 · JFK 21:55
    Developed with CodeLauncher
    ? Do have faith in what you're doing.


    http://www.vxiaotou.com