gitcocoapodsgithub-enterprise

How to configure git to use access token in cocoapods specfiles?


I am working on an iOS project with cocoapods, which dependencies are in a GitHub Enterprise (GHE). The Podfile has a podspec repo source in it:

source 'https://git.xxx.com/xxx/podspec-ios.git'

In this repository are about 100 more podspec files in it. Every podspec source is using the https protocol, e.g.

[...]
s.source        = { :git => "https://git.xxx.com/xxx/module-xxx-ios.git"
[...]

Since I am an external freelancer and not directly connected to their network, I have to use SSH to login into the GHE.
When I am trying to install the pods, the CLI wants me to login. But I don't have any credentials (also there is a 2FA login for employees, which doesn't work in the cli). But I am able to create GHE Access Token. Where do I need to configure this? Is it my git cli? Or can I configure Cocoapods to use the Access Token?


Solution

  • The login prompt accepts the access token.

    Initially it didn't work, because my password manager stored the token with a space at position 1