标签云

微信群

扫码加入我们

WeChat QR Code

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.

2018年08月15日26分01秒

Could you add the output of git status?

2018年08月15日26分01秒

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.

2018年08月16日26分01秒

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)"

2018年08月15日26分01秒

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?

2018年08月16日26分01秒

Its deleting files Be Careful

2018年08月15日26分01秒