Sergey的回答(不要相信我)正在起作用:
You can use git add [path]/\*.java
最近的git:
$git version
git version 1.7.3.4
测试文件:
$find -name .git -prune -o -type f -print | sort
./dirA/dirA-1/dirA-1-1/file1.txt
./dirA/dirA-1/dirA-1-2/file2.html
./dirA/dirA-1/dirA-1-2/file3.txt
./dirA/dirA-1/file4.txt
./dirB/dirB-1/dirB-1-1/file5.html
./dirB/dirB-1/dirB-1-1/file6.txt
./file7.txt
git状态:
$git status -s
?? dirA/
?? dirB/
?? file7.txt
添加* .txt:
$git add \*.txt
更新状态:
$git status -s
A dirA/dirA-1/dirA-1-1/file1.txt
A dirA/dirA-1/dirA-1-2/file3.txt
A dirA/dirA-1/file4.txt
A dirB/dirB-1/dirB-1-1/file6.txt
A file7.txt
?? dirA/dirA-1/dirA-1-2/file2.html
?? dirB/dirB-1/dirB-1-1/file5.html