$ sudo gem install cocoapods
Fetching: cocoapods-1.1.1.gem (100%)
Successfully installed cocoapods-1.1.1
Parsing documentation for cocoapods-1.1.1
Installing ri documentation for cocoapods-1.1.1
1 gem installed
~/.cocoapods should contain .git
~/.cocoapods has only repos folder
$ pod setup
Setting up CocoaPods master repo
fatal: Not a git repository (or any of the parent directories): .git
[!] The `master` repo is not a git repo.
ℹ Please replace this with the output of pod env.
CocoaPods : 1.1.1
Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
RubyGems : 2.0.14.1
Host : Mac OS X 10.12.1 (16B2555)
Xcode : 8.1 (8B62)
Git : git version 2.9.3 (Apple Git-75)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - @ fatal: Not a git repository (or any of the parent directories): .git
Executable Path: /usr/local/bin/pod
cocoapods-deintegrate : 1.0.1
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.1.1
cocoapods-try : 1.1.0
~/.cocoapods is not supposed to be a git repository, ~/.cocoapods/repos is a directory which contains Sources which may be git repositories.
It looks like your issue is that ~/.cocoapods/repos/master is not a git repository, and you should probably run rm -rf ~/.cocoapods/repos/master && pod setup
Thank you, worked
Most helpful comment
~/.cocoapodsis not supposed to be a git repository,~/.cocoapods/reposis a directory which contains Sources which may be git repositories.It looks like your issue is that
~/.cocoapods/repos/masteris not a git repository, and you should probably runrm -rf ~/.cocoapods/repos/master && pod setup