JSWilson
JSWilson

Reputation: 1195

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

I have been using Xcode to develop and publish apps for almost a year. I have been using git as the local repository and bitbucket as the remote repository. Everything has been going fine until this morning. I am now getting an error 'The working copy "xxx" failed to commit files. Please tell me who you are.' Xcode then suggests that I run git config and give it an email address and name. I have no idea why it suddenly needs to know who I am. I don't know who it thought I was before and I don't want it to become more confused than it is now. I have not done anything with command prompts on the Mac so I am not sure where it expects me to enter this information. I vaguely recalled seeing suggestions on using the command prompt to set up bitbucket a year ago but they looked confusing so I did everything from the xcode GUI. Is this something new in xcode 4.6? What do I do?

Upvotes: 45

Views: 24249

Answers (5)

Plexander
Plexander

Reputation: 61

A file being Committed can cause the error:

The working copy '' failed to commit files. Couldn't communicate with a helper application

For those using Xcode for Source Control, and who have tried with no success:

xcrun git config --global user.name "Toto" and
xcrun git config --global user.email [email protected]

Check to see if a file being Committed is causing this problem.

Here's how to navigate through this error: When committing, uncheck one file at a time and try Committing. If that doesn't work, uncheck multiple files and only leave a few or one checked.

What to expect: Eventually, you should figure out which file is preventing the communications with the git. Once all the other files are Committed, disregard all changes. Everything should work fine after this.

How might files change without being tracked? A file changed without being tracked by Source Control will cause this problem. This could happen if perhaps you had to switch MacBooks to a backup so you could send off your primary MacBook for repair. Using Dropbox to sync up your files works, for the most part, but the original Xcode may make a subtle change that was not tracked in the MacBook the project is being migrated to.

Upvotes: 2

Nostradamus
Nostradamus

Reputation: 1557

In case none of the above solutions worked, wanted to mention that in my case I got this error when dragging some libraries into my svn project which were from github and under some kind of GIT control.

Upvotes: 0

zevij
zevij

Reputation: 2446

An alternative: Assuming you have actually configured git to work with xcode and assuming it is just xcode playing up, you can try this as an alternative in xcode when your project is open:

Source Control -> Configure -> click "ok"

This seem to refresh the config you set up initially.

Upvotes: 0

TonioGA
TonioGA

Reputation: 371

I faced the same issue after installing Xcode 7. The solution provided by Kent Latimer worked for me. Config without --global in workspace directory from terminal.

xcrun git config user.name "Toto"
xcrun git config user.email [email protected]

Upvotes: 21

Kenneth Vittetoe
Kenneth Vittetoe

Reputation: 969

I was getting this also. at first I could restart the mac and everything was working fine. Eventually though the problem came back with a vengeance even with a restart it would not let me commit so I had to do the command line loving. one caveat being that you have to type xcrun before any git commands in terminal when using vanilla git installed with Xcode.

so type:

xcrun git config --global user.email [email protected]
xcrun git config --global user.name "your name"

after doing this everything was fine and dandy.

Upvotes: 96

Related Questions