ios - Xcode 11 SPM 身份验证失败,因为未提供凭据

标签 ios swift xcode git swift-package-manager

我开始使用 Swift 包管理器,当我使用 https ( https://github.com/Alamofire/Alamofire.git ) 添加存储库时,当我尝试使用我的 github 帐户登录时,地址验证总是失败

Xcode authentication fail

但是如果我使用 git@github.com:Alamofire/Alamofire.git 它将成功添加。我尝试重新生成新 key ,删除 .ssh 目录,但没有任何东西使 https 工作,并且我仍然收到 xcode 身份验证失败,因为没有提供凭据错误。我可以在本地使用 ssh url,但在 CI 中我需要一个带有 https 的 ssh url。

最佳答案

这是 git 配置的问题。在 .gitconfig 文件中它被设置为

[url "git@github.com:"]
    insteadOf = https://github.com/

删除此部分后,https 可以正常工作

编辑:正如评论中提到的,您可以使用命令轻松地在终端中访问 gitconfig:git config --global --edit

关于ios - Xcode 11 SPM 身份验证失败,因为未提供凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58165880/

相关文章:

ios - 隐藏 ViewController 后实例化按钮不起作用

ios - swift:一段时间后重复动画

ios - 调试在 XCode 下不会重现的 NSNotification 崩溃

android - 为 QuickBlox 开发 Flutter 插件与使用 native 插件开发 native 应用程序

ios - @lvalue NSMutableArray' 不可转换为 'SequenceType'

ios - 错误 ITMS-90168 : "The binary you uploaded was invalid."

ios - UIButton (IB) 中的属性 titleLabel 不尊重 setFont

ios - 是否可以在 UINavigationContoller 堆栈上推送 2 个单独的 UIViewController 实例

xcode - 当玩家移动时 SKCameraNode 滞后

swift - 哪些 Emoji 字符用作 Swift 标识符?