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 entry | Meaning |
|---|---|
| No version | Any 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
- Prefer a pinned version or a narrow
~>with three digits for routine dependencies. - When you need
:git, use:commitand add a comment saying why and who owns removing it. - Never leave a
:gitline with no reference. - Commit
Podfile.lockso the resolved result is recorded. - Search your Podfile for
:gitin every release review. - 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.