5

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.

9
  • 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. Commented May 22, 2013 at 22:18
  • Could you add the output of git status? Commented May 22, 2013 at 22:20
  • 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. Commented May 22, 2013 at 22:21
  • 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)" Commented May 22, 2013 at 22:26
  • 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? Commented May 22, 2013 at 22:29

1 Answer 1

3

Untracked files can be removed with git clean. Use git clean -n to preview which files will be removed and git clean -f to remove them.

Sign up to request clarification or add additional context in comments.

1 Comment

Its deleting files Be Careful

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.