"pod init" creates error that says "You need at least git version 1.8.5 to use CocoaPods"

Ishika picture Ishika · Jun 30, 2017 · Viewed 22.3k times · Source

I was not able to install any pod in my system. Hence, I removed cocoapods from my Mac and then reinstalled it. The process was successful but when I run the command pod init following error shows up in the terminal:

`verify_minimum_git_version!': [!] You need at least git version 1.8.5 to use CocoaPods (Pod::Informative)
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:49:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'

I also checked my Git version which was 1.8.4 but I am getting any solution to update the same.

Answer

Krunal picture Krunal · Sep 27, 2017

It needs to set your command line tool version, in your Xcode (Preferences).

You can download latest command line tool from Apple Download Portal, if you have paid apple developer account/id.


Here are current stable and beta Xcode Tools and supporting command line tool download links. (Ensure you're logged in using premium developer account on Apple Developer Account to access these links)

Xcode 11

Xcode 10

Once you've latest command line tool installed in your system, set it from Xcode Menu.

(Xcode Menu Items) Xcode ► Preferences ► Location ► Command Line Tool ► Select appropriate command line tool

enter image description here

enter image description here