I have a lot of files after git status
. Is there any way to commit specific subset without manually specifying every file's path in this subset.

- 399
- 1
- 4
- 12
-
1I often do something like `git diff --name-only |
| xargs git add` – Ismail Badawi May 17 '17 at 04:06 -
`git add` supports fileglobs. – ElpieKay May 17 '17 at 05:35
2 Answers
You can commit all files by doing a git add .
or just specifying the directory that they're in: git add ./folder/
or to add all files that begin with "test": git add test*

- 1,058
- 11
- 20
-
1+1 but be aware of the difference between `git add .` and `git add -A` → http://stackoverflow.com/a/572660/26396 – Enrico Campidoglio May 17 '17 at 06:47
Adding the files without specifying their path (at least implicitly by using wildcards for example) in not possible, anyway, you can use wildcards to do this (matching text patterns, not only matching fix text).
Some suggestions:
Add all the changes: git add .
(including the tracked files).
Add all tracked changed files: git add -a
Add all files and sub folders in a folder: git add PathToFolder/Folder
or use the relative path depending on Git repository root: git add ./RelativePath/Folder
.
Add all C# files: *.cs
Add all files including text: git add *YourText*
(maybe this is what you want, no need to specify the path, just any common string in files names!)

- 14,913
- 17
- 70
- 99