How do I recursively add files by a pattern (or glob) located in different directories?
For example, I\'d like to add A/B/C/foo.java and D/E/F/bar
A/B/C/foo.java
D/E/F/bar
put line in ~/.gitconfig
[alias] addt = !sh -c 'git ls-files | grep \"\\.$1*\" | xargs git add' -
If you want to add all modified java file can just do: git addt java
git addt java
Samely, if you want to add all modified python file can just do: git addt py
git addt py