In Git, whenever I need to stage files I can use
git add .
to add all the files that have modified since my last commit. However when I remove one file I have to remove it one by one by doing
git rm 'filename'
And git rm .
simply deletes everything that was being tracked by git.
I was wondering if there is a command similar to git add .
but for git rm
.
Thanks :)
EDIT:
I think I didn't explain myself correctly. Lets say I have some files in my git directory which are being tracked by git and lets call them file1
, file2
, file3
. If I where to remove (rm command) file1
and file3
then git status
will tell me that those files where deleted and to execute git rm "filename"
to update what will be committed. So the question is, is there a way to add this removing action of both files with one single command?
If I where to modify/add different files then I could simply run git add .
and all modifications/additions will be added to the staging area so as to be committed.