Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 如何使用通配符在同一个提交中添加多个文件_Git_Wildcard_Git Commit - Fatal编程技术网

Git 如何使用通配符在同一个提交中添加多个文件

Git 如何使用通配符在同一个提交中添加多个文件,git,wildcard,git-commit,Git,Wildcard,Git Commit,我有7个文件要提交到远程repo,它们以单词“Sanity…”开头 例如,Sanity1、Sanity2、Sanity3等 我希望能够使用通配符字符串一次性提交它们,而不是一个接一个地提交它们 请问这可能吗 谢谢当然,首先使用通配符添加它们(实际上由shell而不是git解释),然后提交 git add Sanity* git commit -m 'Sanity files added' 您可以引用通配符来防止shell解释它,因为git也可以这样做: git add 'Sanity*' 我

我有7个文件要提交到远程repo,它们以单词“Sanity…”开头

例如,Sanity1、Sanity2、Sanity3等

我希望能够使用通配符字符串一次性提交它们,而不是一个接一个地提交它们

请问这可能吗


谢谢

当然,首先使用通配符添加它们(实际上由shell而不是git解释),然后提交

git add Sanity*
git commit -m 'Sanity files added'
您可以引用通配符来防止shell解释它,因为git也可以这样做:

git add 'Sanity*'

我仔细研究了@choroba的答案,发现你可以处理多个起始角色

git add a* b* 
将添加以
a
b
开头的所有文件

希望这对其他人也有帮助

git提交健全性*-m“提交健全性文件”