git add .
git commit -m "message"
git push
How to add multiple files in git
Question
I have 4 files in a folder. I have modified 3 of them. How do I add and push only the modified files all at once. Will "git add ." work here.
La solution
Autres conseils
Update
Yes in that case you can simply use git add .
. You can check which files have been modified by using git status
. If only your three files are being displayed, a simple git add .
is enough, afterwards use git push
.
1) You can add only the three modified files with:
git add file1 file2 file3
2) OR You can add all the files with
git add .
3) OR If they are all of the same type and say, the fourth one has a different extension, then you can also add the three files using:
git add *.js //example for files with Javascript .js extension
Then do : git commit -m "message"
and then a : git push
git add -A
stages All;
git add .
stages new and modified, without deleted;
git add -u
stages modified and deleted, without new.