Safeguard
Supply Chain•

Should you commit the CocoaPods Pods directory for CI?

Committing the Pods folder makes builds independent of the network and review easier, but bloats the repo. Here is the trade-off and what to do either way.

Safeguard Security Team
4 min read

It is a trade-off, and CocoaPods leaves it to you. Committing Pods makes builds work without the network and lets reviewers see exact dependency code. Ignoring it keeps the repo small. Either way, always commit the Podfile and Podfile.lock, and have CI build from the lockfile.

What the CocoaPods guide says

The official guide says whether you check in the Pods folder is up to you, since workflows vary. It recommends keeping the Pods directory under source control and not adding it to your gitignore, but says the decision is yours.

Benefits it lists for checking in:

  • After cloning, the project can build and run without CocoaPods installed, without running pod install and without internet access.
  • The artifacts are available even if the source of a pod, such as a code host, goes down.
  • The artifacts are guaranteed identical to those of the original installation.

Benefits it lists for ignoring:

  • A smaller repository.
  • As long as sources are available, CocoaPods can generally recreate the same installation. The guide adds a caveat: there is technically no guarantee that pod install will fetch identical artifacts when you are not using a commit SHA in the Podfile, especially with zip files.
  • No conflicts when merging branches with different pod versions.

Regardless, it says Podfile and Podfile.lock should always be under version control. The lockfile records the exact version of each pod, and CocoaPods honours it unless you update the dependency or run pod update.

Security view

QuestionCommit PodsIgnore Pods
Can a registry or code host change affect a build?Not for already-committed codeYes, if not pinned by commit
Can reviewers see dependency changes?Yes, in the diffOnly in the lockfile
Repo size and noiseLargerSmaller
Works during an outageYesOnly with a cache or mirror
Risk of a malicious change slipping in a huge diffReal, because diffs get hugeLower, but unseen

The committed route gives you a stable copy and visible changes, but a large generated diff is easy to skim past. The ignored route is lean, but you rely on the sources staying honest, which is why pinning and verification matter.

Whichever you choose

  1. Commit Podfile and Podfile.lock and review lockfile diffs.
  2. Prefer pinning sources by commit where you use git sources.
  3. In CI, install from the lockfile and fail if it would change. Do not run a blanket update in a release job.
  4. If you ignore Pods, cache the downloads keyed on the lockfile hash, as in our post on cache keys.
  5. If you commit Pods, review changes to that folder, perhaps by scripting a summary of changed pod names and versions.
  6. Keep a dependency inventory that is separate from either choice, so you can answer which version of a pod shipped.

Note on the trunk

CocoaPods Trunk has had published vulnerabilities in the past. Our post on Podfile.lock integrity risks covers that background. Check current advisories before relying on a single source.

Try it yourself

Open the demo and look at how a full inventory lists every component, direct and transitive. That list is the review aid you want whichever way you handle the Pods folder.

Click through it at your own pace, or open it full screen.

Where Safeguard fits

Safeguard scans Podfile.lock and other lockfiles to produce an SBOM, runs reachability analysis, and applies policy gates. Try a free scan.

Quick check

Is the lockfile enough on its own?

It pins versions, but the guide notes recreation is not guaranteed to be identical unless sources are pinned by commit. Consider that when choosing.

Do I need the Pods folder to build on CI?

Only if you commit it. If you ignore it, CI runs pod install from the lockfile.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.