Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode and Git Source Control : "The working copy XXXXX failed to commit files"

Tags:

git

xcode

commit

I know this may be an ultra-newbie question, but - although I've been coding for like 18 years - it's been only a few days that I've been using Source Control for my project and I feel quite lost.

I have set up Git properly and, from time to time, I'm commiting the changes.

(File -> Source Control -> Commit)

However :

Whenever I try to delete a file (that initially existed) and then commit the changes, I'm getting an error like this :

The working copy "MY_COPY_NAME" failed to commit files

fatal: could not switch to "/the/path/of/the/file/i/just/deleted": no such file or directory

What's going on?

What should I do in order to commit the changes even after a file has been deleted?

like image 428
Dr.Kameleon Avatar asked Oct 08 '22 00:10

Dr.Kameleon


1 Answers

you should run

git add -u your_file

the -u means you want to update the file you already added. Another possibility is

git rm your_file

And it's likely you get an error if Git does not find an inexisting

like image 103
Vince Avatar answered Oct 12 '22 00:10

Vince