Reputation: 5158
Simple question. How can I just add modified and tracked files in the current directory to the repository ?
Suppose I have 3 modified files.
Utils/readme.txt
code/main.pas
code/feature.pas
The current dir is in code/. So I want to commit only main.pas and feature.pas file.
Upvotes: 5
Views: 5751
Reputation: 1672
You could do:
git add -u /path/to/folder
However, that will add files in subdirectories of that folder as well, which might not be what you want. If you don't want subdirectories and you are in a bash shell, you can try:
git add /path/to/folder/*.*
That command will add any file in a folder as long as those files follow the standard name.extension naming convention.
Upvotes: 7
Reputation: 28609
To commit only already tracked files:
git add -u
This will also take any files that have been deleted, but will not add newly created files.
Upvotes: 4