This is a two part question: 1) I have added committed and pushed all pod files to github. Is there a way I can remove them and not push them again to github?
2) I know gitignore can help, but I don't know how to use it. Can anyone please walk me through the process of using gitignore?
so I think what I can do is, get the project from github, add gitignore, and then push again. is that correct?
Please help, new to github & Xcode.
“CocoaPods manages library dependencies for your Xcode projects. The dependencies for your projects are specified in a single text file called a Podfile. CocoaPods will resolve dependencies between libraries, fetch the resulting source code, then link it together in an Xcode workspace to build your project.
That's correct, you need to add the Pods directory to your .gitignore
1) Remove your files from your github repository:
git rm -r Pods/
and don't forget to commit and push
2) Create a gitignore file:
touch .gitignore
echo "Pods/" > .gitignore
More informations : here
This is what Cocoapods official documentation has to say.
Whether or not you check in your Pods folder is up to you, as workflows vary from project to project.
It recommends that you keep the Pods directory under source control, and don't add it to your .gitignore. But ultimately this decision is up to you:
Benefits of checking in the Pods directory:
Benefits of ignoring the Pods directory:
1.The source control repo will be smaller and take up less space. As long as the sources (e.g. GitHub) for all Pods are available, CocoaPods is generally able to recreate the same installation. (Technically there is no guarantee that running pod install will fetch and recreate identical artifacts when not using a commit SHA in the Podfile. This is especially true when using zip files in the Podfile.)
2.There won't be any conflicts to deal with when performing source control operations, such as merging branches with different Pod versions.
Whether or not you check in the Pods directory, the Podfile and Podfile.lock should always be kept under version control.
Reference Link:Cocoapods Official Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With