Safeguard
Developer Tools•

What does ~> mean in a Podfile, and are git sources safe?

The ~> operator allows updates within a range, and :git sources skip the registry. Learn what each lets in and how to keep Podfile choices reviewable.

Safeguard Security Team
3 min read

In a Podfile, ~> means "this version or newer, up to but not including the next step". So '~> 0.1.2' allows 0.1.2 up to, but not including, 0.2. A :git source without a tag, branch or commit follows the master branch, which is much looser and harder to audit.

The version operators

The CocoaPods Podfile guide lists the forms you can use for a pod version:

Podfile entryMeaning
No versionAny version, usually the latest
'1.2.3'Exactly that version
'> 1.2', '>= 1.2', '< 2', '<= 2'Open ended or capped ranges
'~> 0.1.2'0.1.2 up to, but not including, 0.2
'~> 0.1'0.1 up to, but not including, 1.0

Notice that the number of digits you write changes the window. ~> 0.1 is far wider than ~> 0.1.2. Many teams assume the same width in both cases.

Git sources

You can point a pod at a repository with :git, and optionally add :branch, :tag or :commit. Per the guide, without one of these the master branch is used. The podspec must sit in the repository root, unless you use another approach.

From a security view:

  • A tag is a label the maintainer can move. A commit hash cannot be moved.
  • A branch changes with every push.
  • The master default means a fresh install can differ from last week's with no version change at all.

How to keep it reviewable

  1. Prefer a pinned version or a narrow ~> with three digits for routine dependencies.
  2. When you need :git, use :commit and add a comment saying why and who owns removing it.
  3. Never leave a :git line with no reference.
  4. Commit Podfile.lock so the resolved result is recorded.
  5. Search your Podfile for :git in every release review.
  6. Read pod install vs pod update so you know when ranges actually move.

Try it yourself

Click through it at your own pace, or open it full screen. Check how a version number and its source are shown for each package.

Safeguard builds an SBOM and scans your dependencies for known vulnerabilities, and you can run a free scan at gold.safeguard.sh/scan to see what your own project pulls in.

Quick check

Is ~> 1.0 the same as ~> 1.0.0?

No. The first allows up to, but not including, 2.0. The second allows up to, but not including, 1.1.

What does a Podfile git line with no tag do?

Per the CocoaPods guide it uses the master branch, so the code can change between installs.

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.