应该使用什么选项将git diff限制为一组给定的文件扩展名? [英] What option should be used restrict the git diff to a given set of file extensions?

查看:167
本文介绍了应该使用什么选项将git diff限制为一组给定的文件扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个选项可以将 git diff 限制为一组给定的文件扩展名?

解决方案

是的,如果你确保git展开一个glob而不是你的shell,那么它将在任何级别匹配,所以像这样(引号是重要的)应该可以正常工作。

  git diff  - '* .c''* .h'


Is there an option to restrict git diff to a given set of file extensions?

解决方案

Yes, if you ensure that git expands a glob rather than your shell then it will match at any level so something like this (quotes are important) should work fine.

git diff -- '*.c' '*.h'

这篇关于应该使用什么选项将git diff限制为一组给定的文件扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆