Showing which files that match a specific pattern have changed between git branches

旧时模样 提交于 2020-01-30 11:41:34

问题


I want to merge two branches but before, I'd like to review the changes between the two branches on all files whose filename ends with .twig.

Is it possible, or should I use some bash-magic like git diff --name-only branch1..branch2 | grep .twig ?


回答1:


You can pass the file names to git diff after a --, so:

git diff --name-only branch1..branch2 -- '*.twig'

Should do what you want. I put *.twig in single quotes so the shell won't expand it.



来源:https://stackoverflow.com/questions/17215172/showing-which-files-that-match-a-specific-pattern-have-changed-between-git-branc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!