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 · 1897 次点击
    这是一个创建于 874 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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   ·   我们的愿景   ·   实用小工具   ·   4987 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 01:13 · PVG 09:13 · LAX 18:13 · JFK 21:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.