xcode 使用名称和密码对 Github 遥控器进行身份验证

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15143995/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:52:51  来源:igfitidea点击:

Authenticating to a Github remote with name and password

xcodegitgithub

提问by Neznajka

I need upload project to friend's github account. I have login and password. When I try to push project it's always ask name and password, I try to type login and password or main directory of github (paint out on screen with black) with password, try with empty password, but always take alert that it is incorrect name or password. I try to create repo on github and clone it to my Mac and then copy files to this cloned repo and after commit - push. But again I need type name and password. What is it? Some screens:

我需要将项目上传到朋友的 github 帐户。我有登录名和密码。当我尝试推送项目时,它总是询问名称和密码,我尝试使用密码输入登录名和密码或 github 的主目录(在屏幕上用黑色绘制),尝试使用空密码,但始终注意名称不正确或密码。我尝试在 github 上创建 repo 并将其克隆到我的 Mac,然后将文件复制到这个克隆的 repo 并在提交后 - 推送。但我再次需要输入名称和密码。它是什么?一些画面:

repo on github

enter image description here

在此处输入图片说明

add repo in xcode

enter image description here

在此处输入图片说明

What I need type in this fields?

enter image description here

在此处输入图片说明

Try type login and password, title of main directory and password, git-password, and all this names with empty password field. Always I see: enter image description here

尝试输入登录名和密码、主目录的标题和密码、git-password 以及所有这些名称,密码字段为空。我总是看到: 在此处输入图片说明

回答by Nevik Rehnel

You are using the SSH URL, which requires you to (generate and) register a public RSA key with Github before you can authenticate.

您正在使用 SSH URL,这要求您在进行身份验证之前(生成和)向 Github 注册公共 RSA 密钥。

If this is a one-time thing, you can just switch to the HTTPS URL (see the repo's page on github), which allows you to authenticate with the github username and password combo.

如果这是一次性的事情,您可以切换到 HTTPS URL(请参阅 github 上的 repo 页面),这允许您使用 github 用户名和密码组合进行身份验证。

Edit:

编辑:

  • For more information about how to generate and use SSH keys, check out Github's SSH help articles
  • For a detailed comparison of the transport protocols supported by Git and their advantages and disadvantages, with respect to Github, see this comparative article