0

When I do git status, I get this result:

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#   (use "git push" to publish your local commits)
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   OnlineMarketing/OnlineMarketing-Info.plist
#   deleted:    OnlineMarketing/icon-100.png
#   deleted:    OnlineMarketing/icon-1024.png
#   deleted:    OnlineMarketing/icon-144.png
#   deleted:    OnlineMarketing/icon-152.png
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   OnlineMarketing.xcodeproj/project.xcworkspace/xcshareddata/
#   OnlineMarketing.xcodeproj/project.xcworkspace/xcuserdata/alexgenadinik.xcuserdatad/
#   OnlineMarketing.xcodeproj/xcuserdata/alexgenadinik.xcuserdatad/
#   OnlineMarketing/.DS_Store
#   OnlineMarketing/Default-568h@2x copy.png

My question is what I should do with these iOS untracked files from xcode? They seem to be project files. Should I commit them? Or should they remain local for me?

The reason I am trying to figure this out is that I tried to work with another branch and I got this error:

git checkout -b vidals-mods origin/vidals-mods
error: The following untracked working tree files would be overwritten by checkout:
    OnlineMarketing.xcodeproj/project.xcworkspace/xcshareddata/OnlineMarketing.xccheckout
Please move or remove them before you can switch branches.

Thank you!

Genadinik
  • 18,153
  • 63
  • 185
  • 284
  • @lwburk not sure it is a duplicate because what about the .DS_Store file? And I am still not clear if I should commit these .xcodeproj files not? – Genadinik May 27 '14 at 15:51
  • `.DS_Store` is not specific to XCode. It's an OS X metadata file. It should never be checked into version control. My general point is that this has been asked many times. See here: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects – Wayne May 27 '14 at 16:00
  • @lwburk thanks. But what should I do with .DS_Store? Take a look at my question update. The reason I am asking this question is that I have an error from git complaining about my files not being committed and for that reason it isn't letting me switch to another branch. – Genadinik May 27 '14 at 16:07
  • Add those files to your `.gitignore` – Wayne May 27 '14 at 16:08

1 Answers1

1

The result says

You have modified your project info plist and deleted those icon files

There are some files that change automatically if you run the project and those are machine environment dependent. These xcuserdata could safely be ignored. No need to commit them.

I think you have your Default-568h@2x.png. In that case no need to commit Default-568h@2x copy.png ether.

No need to commit untracked files here.

What should Xcode 5 gitignore file include?

How do I remove local (untracked) files from my current git branch?

Community
  • 1
  • 1
Warif Akhand Rishi
  • 23,920
  • 8
  • 80
  • 107
  • Thank you. I tried to work with a different branch and I got an error message. I just added that error to my original question. Maybe it helps to understand my situation. – Genadinik May 27 '14 at 15:57
  • The error is asking you to remove untracked files before you switch branch – Warif Akhand Rishi May 27 '14 at 16:07