This question already has an answer here:
So I added a bunch of images to my project that has git enabled. I then renamed all the images in Xcode. Now whenever I select commit, these files with the old file name pop up with a question mark. The question mark indicates they are not under source control, I believe, which is fine. They should not be. So how can I get them out of the list? How can I avoid this from happening in the future, other than renaming outside of the project before importing?
Note: I did not check them in or commit them before renaming. At least I don't think I committed them. They are not in the remote, nor do I want them to be.
It's unclear from your question, but did you check them in previously with the old names? Assuming I've understood the current state of your local repo, you need to git rm the old file names and commit the deletions.
Could you add the output of git status?
I have not checked anything in. I don't believe I've committed the original names, nor do I have any need for any history with the original names. There are a bunch of files, so if there's something I can do in batch or with a single command, that would be preferred.
The git status produces a list of all the files I want removed with # at the start of each line. There are no uncommitted files. Then "nothing added to commit but untracked files present (use "git add" to track)"
So you just don't want these files to be managed by git, and you've never made them known to git. is this correct? If so, is there some reason why just adding these file names to your .gitignore will not work?
Its deleting files Be Careful