IOS practice for using cocoapod and source control

Currently in our company, we are just passing all containers (like AFNetworking, Realm, etc.) to svn / git. From time to time when another developer installs a pod, update pod, conflicts arise.

We also use this so that we don't touch other pods.

pod install --no-repo-update

      

May I know what is good practice for using third party modules? Do I need to commit these pods?

Or just restart the program after our codes are extracted? I just want to avoid code conflict for using containers.

+3


source to share


4 answers


You can refer to http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control



Whether you check in or not, the Pods directory, Podfile and Podfile.lock should always be under version control. It is recommended to keep it under version control and not add it to your .gitignore

+2


source


We also faced the same problem. As a solution in commit, we only write the pod file with the required list of items. Whenever the other person is updated, their podkile is updated and then from the console they update their projects.



As a pod is the same for everyone, so you don't need to commit the pods. for more specific you can give a pod with a version.

+1


source


In my opinion we are not pushing all the pods to svn or git. You can only commit the Podfile, and you may want to freeze a specific version of the Pod, in which case you can specify that version number.

pod 'Objection', '0.9'

And when other members install containers, they will be the same.

0


source


Hunt is usually not a good practice to upload your dependencies to your repositories, mainly because you will save space and time. it's ok to push your subfile, but all your dependencies code should be omitted and installed locally for each developer. And every time a new dependency is added or updated, you just need to run the command pod update

. for this you can add to your .gitignore file on a new line only Pods/

. Anyway, if you are working on a large-scale application, you should quickly work on best practices and use .gitignore correctly like this example , and also if you want to know some pros and cons of missing Cocoapods dependencies, you can check this official documentation

0


source







All Articles