Steve McLeod
Steve McLeod

Reputation: 52448

Git confused because file has been replaced with folder of the same name

I downloaded and opened Apple's new Pages version 5 (the Mavericks one). I opened and edited a file I have under Git control. Apple updated the file to its new format. The new format seems to be a folder with a series of files inside of it, maybe something akin to an app bundle.

Now when I tried to commit the change with Git, I get this message:

error: unable to index file docs/mydoc.pages
fatal: updating files failed

I have no idea how to deal with this. How can I get Git to accept that the file has been replaced with a folder with the same name?

Upvotes: 2

Views: 107

Answers (1)

Steve McLeod
Steve McLeod

Reputation: 52448

So @knittl's answer worked:

git rm --cached --ignore-unmatch mydoc.pages; git add mydoc.pages

Upvotes: 1

Related Questions