1

When I try to commit I get the following error:

The working copy "Chord Attack" failed to commit files. fatal: Will not add file alias 'Chord Attack/GameResources/GUI/Chord Attack/chordattackbg.png' ('Chord Attack/GameResources/GUI/Chord Attack/ChordAttackBG.png' already exists in index) 

I can't even find that file in my directory or anywhere on my computer. I deleted that from my project a long time ago. I even recreated my project and manually added files one by one and some how this happened again. I saw another post that said to delete the file and manually re-add it, but it didn't work. Currently, the chordattackbg.png file is in my project. I tried deleting that and then committing, but the same error came up. What am I doing wrong?

2 Answers 2

2

This is a case issue (chordattackbg.png vs. ChordAttackBG.png), as described in this question.

You would need to:

git mv ChordAttackBG.png foo git mv foo chordattackbg.png git commit -m "Rename ChordAttackBG.png to chordattackbg.png" 

Then you would apply your modifications to chordattackbg.png, add and commit.

Here the solution was to:

  • clone the local repo again,
  • cleanup its content,
  • rename the file (ChordAttackBG.png to chordattackbg.png),
  • add the new modifications to chordattackbg.png,
  • re-open the project in XCode from the new clone.
Sign up to request clarification or add additional context in comments.

12 Comments

Okay, finally, something worked. I've clone it. Weird, I see a lot of old files in the cloned version that I don't currently have in my project.
@02fentym maybe it is best to work in that new clone: cleanup old files, git add -A, git commit, and see if you can commit your chordattackbg.png there.
So I should add chordattackbg.png into the cloned repository then try to commit it? Should I delete ChordAttackBG.png first?
@02fentym maybe try to rename it first (as in my original answer). Then, if the case is right, report your modifications in the renamed chordattackbg.png.
Oh yeah, I forgot. Okay, it looks like it has worked! Should I try to commit via Xcode now?
|
0

I solved this problem deleting this file:

/path/to/project/folder/.git/index.lock

Then I could commit from Xcode with no problems. Hope this helps!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.