Cocoapods Error – “You need at least git version 1.8.5 to use CocoaPods”

Introduction Cocoapods
Cocoapods are best dependency manager tool that is used in iOS App Development. Languages swift and objective-c are user for iOS App Development.

Cocoapods Error Solution 1

Follow this :Xcode Preferences -> Locations -> Selected the Command Lin Tools: select Xcode 8.3
or run this command sudo xcode-select –switch /Applications/Xcode.app

Or

Cocoapods Error Solution 2

You can try this also if above method does not work

Firstly remove the existing git in your system using commands:-

Then use command “which git” that will give u the path say for example “/usr/local/bin/git”, after that use command->$ sudo rm -rf /usr/local/bin/git

and noe this will remove existing git from your system after this again reinstall git

$ brew install git
Maybe it can issue a warning saying
Warning: git 2.13.2 is already installed, it’s just not linked.
You can use `brew link git` to link this version.

Then run below mentioned command:-

$ sudo chown -R $(whoami) /usr/local/share/
$ sudo chown -R $(whoami) /usr/local/lib
$ brew link --overwrite --dry-run git

It might give you error
Error: Could not symlink share/git-core/templates/description
Target /usr/local/share/git-core/templates/description
already exists. You may want to remove it:
rm '/usr/local/share/git-core/templates/description'

And to force the link and then overwrite all conflicting files use: brew link –overwrite git

To list all files that would be deleted: brew link –overwrite –dry-run git

Then finally run command

$ brew link --overwrite git

This is how I updated my git and pod init worked. Hope you find it helpful 🙂

Leave a Comment