First of all, I think you need to make sure you have not added those files to the temporary storage area before. If you have added them, then .gitignore will not take effect on those files. If this is the case, you can refer to the question that has been asked in the forum - git ignores files that have been submitted.
Also, I want to know why you want to delete all those files? In fact, there is no need to do this operation. Under normal circumstances, as long as you add certain files to ignore in .gitignore, you can automatically ignore those files when submitting.
First of all, I think you need to make sure you have not added those files to the temporary storage area before. If you have added them, then
.gitignore
will not take effect on those files. If this is the case, you can refer to the question that has been asked in the forum - git ignores files that have been submitted.Also, I want to know why you want to delete all those files? In fact, there is no need to do this operation. Under normal circumstances, as long as you add certain files to ignore in
.gitignore
, you can automatically ignore those files when submitting.Root directory file
.gitignore
If it has been submitted (and you still want to keep it), delete it and submit it again, then modify gitignore, and then save it to the directory