3

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.

Yanis Urbis
  • 399
  • 1
  • 4
  • 12

2 Answers2

6

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*

Nick Rucci
  • 1,058
  • 11
  • 20
2

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!)

Mohammed Noureldin
  • 14,913
  • 17
  • 70
  • 99