Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pod Install doesn't have access to private repo but git clone, etc. work on the same repo

We have a project that has a private repo. I have access to this repo as I can git clone, etc. for that repo.

However, pod install on this same repo always asks for my login credentials, getting the following message:

remote: Repository not found.
fatal: Authentication failed for 'https://github.com/TEAM/Pod.git/'

I am using an ssh connection. I wouldn't think that the issue is related to this as, like I mentioned, I can clone/pull/etc. successfully.

It is also worth noting that two other's on the team are able to pod install and pod update without any issues.

I've also wiped my credential-osxkeychain.

Thoughts? I'm running out of ideas.


Added details:

I can pod install in the Podfile, but this is for a Cocoapod we are creating, and the pod I'm having issues with is a dependency for this pod. Therefore in the Podfile we have put

#source 'https://github.com/TEAM/PodSpecs.git'
#source '[email protected]:TEAM/PodSpecs.git'

where only one of those is uncommented (but neither work for me -- though both work for them).

And then in the Podspec we have

s.source = { :git => 'https://github.com/TEAM/PodSpecs.git'}

We have even tried:

s.source = { :git => '[email protected]:TEAM/PodSpecs.git'}

I have also done the following command and verified the existence of the repo in ./cocoapods/repos:

pod repo add Pod [email protected]:TEAM/PodSpecs.git
like image 585
EndersJeesh Avatar asked Feb 03 '23 21:02

EndersJeesh


1 Answers

In your Podfile instead of pointing to your private github repository via the https protocol use the git one:

pod 'MyPrivatePod', :git => [email protected]:<username>/myprivatepod.git

To avoid to type your password of your private key each time, be sure you've added it to your opened session. If you are on MacOS:

ssh-add ~/.ssh.id_rsa
like image 100
Yannick Loriot Avatar answered Feb 07 '23 08:02

Yannick Loriot