I have a Git repo that I have deleted four files from using rm
(not git rm
), and my Git status looks like this:
# deleted: file1.txt
# deleted: file2.txt
# deleted: file3.txt
# deleted: file4.txt
How do I remove these files from Git without having to manually go through and add each file like this:
git rm file1 file2 file3 file4
Ideally, I'm looking for something that works in the same way that git add .
does, if that's possible.
git rm
, the removal could have been from a separate tool, IDE or file manager. Visual Studio for one can be a pain when removing/renaming files. – Hobbemagit rm
is a bit like asking why they don't usegit vim
orgit cd
. It's a stupid thing to have to do, and git should have a built-in command or alias to remove deleted files from staging, and you shouldn't have to look it up on SO or read man pages on your lunch break. – Boogeymangit add -u
will add all modified files that are being tracked. It make work because of circumstances (everything else has been committed), but if you're hoping it will just synchronize your deletes, then you may have some work finding the proper commit for some edits later. – Liquid