-2

I'm programming in xcode (actually Phone Gap in conjunction with xcode) with git. I'm having a strange issue. When I create two identical branches and try to check out back and fourth between them with out making any changes git is telling me that I need to commit because a change has been made (this same thing is also resulting in merge conflicts). It says the changed file is:

platforms/ios/Butterfli.xcodeproj/project.xcworkspace/xcuserdata/benpearce.xcuserdatad/UserInterfaceState.xcuserstate

Can anyone explain what's going on and how to deal with it.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Ben Pearce
  • 6,884
  • 18
  • 70
  • 127

1 Answers1

0

Yes, .xcworkspaces are simply files that Xcode uses to describe the workspace or projects.

IMHO, There's no need to check these files in at all, unless you share settings with other folks in your projects (and in your case, I suppose other machines that have a user named "benpearce").

In fact, you can safely add them to your .gitignore file.

More info can be seen here

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • I'm a bit of a git/unix noob. Is the command for that "git ignore *.xcworkspaces"? – Ben Pearce May 15 '14 at 04:53
  • you have to edit the "`.gitignore`" file that lives in the root of your git repo, which in your case would be the same folder your "`platforms`" source code folder lives in. You can use a Macintosh text editor (making certain the file remains a plain text file with no "`.txt`" extension) or you can use "`emacs`" or "`vi`" in Terminal. – Michael Dautermann May 15 '14 at 04:56
  • Since it's already tracked you need to also run `git rm --cached unwanted_path`. Only Then git will ignore the specifued files – kaman May 15 '14 at 05:40
  • Thanks for the info everyone, I'm still trying to get this implemented properly. @MichaelDautermann is ".DS_Store build" in the example supposed to be the path to my xcodeproject? – Ben Pearce May 15 '14 at 23:39
  • @kaman when I run your command I get "fatal: not removing 'platforms/ios/{project_name}.xcodeproj' recursively without -r" – Ben Pearce May 15 '14 at 23:40
  • That means you specified path to a directory not a file. – kaman May 15 '14 at 23:43