Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should xcworkspace be in gitignore

I am using GitHubObjectiveCGitIgnore

When I go in sourcetree to commit I see :

project.xcworkspace 

This file is not ignored using Github .gitignore file. I am not sure do I need to commit and push this file?

like image 843
Radenko Zec Avatar asked Mar 12 '14 08:03

Radenko Zec


People also ask

Should I add Xcworkspace to Gitignore?

In short yes it should be commited. I have my xcworkspace file checked in to my repo. If you don't use a workspace it probably isn't needed but as I use Cocoapods this creates a xcworkspace with the original project and the pods project inside of it.

What is the Xcworkspace file?

xcworkspace file corresponds to a “workspace” created in Xcode via File > New > Workspace... . You can open them in Xcode, just like you can open projects. But it's not actually a file, it's a directory. Only Finder attempts to confuse you by displaying directories with this extension as files.


2 Answers

If you're using Cocoapods, I actually find that the answer depends on a few things.

  • If you just want the project to be compilable and runable "out of the box", then go ahead and check everything in; xcworkspace and all pods.
  • If there is a pod that you need to modify for some reason and you want to include that change with your project, then check everything in. For instance, I've found bugs that haven't been fixed for one reason or another and it was easier to just fix them myself and check in the pod along with my project rather than wait for the updated pod or integrating the library manually (which is essentially the same result as checking the pod in anyways). Alternatively, fork the repo, push your changes to it, and point your pod to your fork.
  • If you have no issues with any of the pods and you've verified that everything works with the versions of the pods you've specified, then you don't have to check in the xcworkspace file or pods. Of course, you'll have to run pod install in this case.

There's no hard and fast rule on what to do here. Sometimes it's worth the extra overhead to just check everything in, and sometimes it's not necessary. It depends on what's most convenient for you.

like image 127
JJC Avatar answered Sep 23 '22 15:09

JJC


In short yes it should be commited.

I have my xcworkspace file checked in to my repo. If you don't use a workspace it probably isn't needed but as I use Cocoapods this creates a xcworkspace with the original project and the pods project inside of it. Use a workspace is the correct way on handling multiple project sets/dependencies.

like image 41
Rich Avatar answered Sep 25 '22 15:09

Rich