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?
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?
If you're using Cocoapods, I actually find that the answer depends on a few things.
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.
pod install
overwriting changes. If the pod already exists in the project, it will not overwrite it. Only pod update
would possibly do that. And, if you're working with a team of developers, you would likely instruct them not to run pod update
unless there's a good reason. The only thing you would be saving is the overhead of syncing those extra pod files to github.
pod install
is run on a new project, hence reinforcing the fact that you should not be checking in the xcworkspace if you don't plan on checking in the pods as well.
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.
pod install
will create one for you but, what you should not check in is the xcuserdata
folder inside the project and workspace folders :)
If you have/or plan to have several projects in the workspace (for example sub projects of your project) then you should not add it to .gitignore
.
Cocoa pods just adds its own project to the workspace if a workspace exists when you do a pod install
.
In general it is safer to include the workspace file in the git commit, even if you exclude pods.
You will have to do a pod install
anyway to compile your project so even if you commit a workspace file that already has the cocoa pod project added it wont cause any issues.