5

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

 2 years ago
source link: https://www.v2ex.com/t/813196
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  git

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

  yazoox · 1 天前 · 1027 次点击
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

dinghmcn   1 天前

git log root\sub2\components\
不行吗? 子目录也算在内

silenceboychen

silenceboychen   1 天前

git log root\sub2\components or git log root\sub3\states\core

dinghmcn

dinghmcn   1 天前

@dinghmcn #1 要同是显示这两个目录可以:
git log -- root\sub2\components\ root\sub3\states\core\

git log -h 看看语法,path 可以多个

shellus

shellus   1 天前

IDEA:打开文件或者选择目录的情况下,点击右上角的时钟图标,下方 git 工具栏就是更改了本文件的所有 commit 列表,点击 commit ,或者多选 commit ,右侧出现影响的文件的 diff 列表,双击可查看更改差异

yyds

ryncv

ryncv   1 天前

推荐一个工具: tig 可以很方便实现你要的效果 直接 tig sub2 就可以

yazoox

yazoox   1 天前

试了试命令
git log d07cc202a..HEAD --oneline -- path/to/my-filder
是可以工作的。
楼主的工具我也会去试试。
谢谢!

risky

risky   7 小时 27 分钟前

可以试试 git kraken 功能很强

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK