DESCRIPTION:
I have a relatively common problem, but it takes a lot of time on the project, so let's go.
Suppose I have a project with the directories examples: css , dist , src , js , fonts , and some files in the root like index.html , readme.md , config.rd and any other files, anyway.
Now suppose that in my src / img directory I have several images that have already been added, commit all this locally even without having to play to the repository.
PROBLEM:
Now for any unimportant reason I've changed all the files in my directory and when I use git status
command it returns me a list of the files new and deleted files , then I run the command git add .
adding all the new files to the stage of what I want to do I commit the changes git commit -m "Atualizada as imagens do projeto"
, ready "perfect".
But if I re-run git status
git returns me the list with ALL those files that no longer exist, and I want them to be deleted from my project commited in git dependencies, but suppose that they are more than 200 and they all have different names and different extensions and are in the same path as my new images, I can not just run git rm src/img/*.jpg
or git rm src/img/*.png
because my new images will be deleted together.
QUESTION:
How can I do so that I can delete all the old files, regardless of the extension, that are in my project comitated there in the dependencies of git, but that no longer exist in my local project, with a command just so I do not have to execute git rm src/img/exemplo01.png
, git rm src/img/exemplo02.png
...?