0

I am working on an ios project and I want to add the project to my gitlab account. I'm using command line for managing git, not XCode.

I wonder what are the files I should exclude from my repository. My candidates for exclusion are from the xcodeproj package only:

  1. The xcuserdata folder but I see it includes scheme information so I'm not completely convinced.
  2. The project.xcworkspace package

Is this correct? Is there anything I'm missing?

Thanks.

The question identified as a possible duplicate asks specifically "in conjunction with Xcode". I am using command line. They're may be no difference but that was part of the question. Besides the answers to that questions are dated and this question may have different answers overtime, at least that is my understanding.

Azul
  • 69
  • 1
  • 7

2 Answers2

4

its great that you are using git for version control and a better thought to it is that, exactly what we should not push to remote while pushing the code. Here are some of the files which are Xcode generated and should not be pushed to remote.

*.xcworkspacedata

*.xcuserstate

*.xcscheme

xcschememanagement.plist

*.xcbkptlist

Add these files to your .gitignore file and enjoy.

Happy coding.

Aman Gupta
  • 985
  • 1
  • 8
  • 18
  • Thanks @Aman Gupta. Some of those files I don't even see in my project. But it's good to know in case they are automatically created at some point or maybe they belong to a different type of project. I'm fairly new to ios but I guess that with new ios versions this list may need to be updated. Thanks again. – Azul Dec 19 '16 at 19:29
  • Don't mention @Azul some of these files are only generated after a build and *.xcbkptlist is generated when you use breakpoint while building, to debug. – Aman Gupta Dec 21 '16 at 01:59
3

It depends a lot on the project. Personally, I use https://www.gitignore.io and use keywords such as "Xcode", "Swift", "MacOS", etc.