在 xcode 用户 ID 密码错误中从 github 克隆存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16044541/
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
Clone repository from github in xcode userid password error
提问by MindSpiker
Open xcode then click "Connect to a repository"
打开xcode,然后单击“连接到存储库”
After entering the URL the button on the bottom changes to clone. FYI The repository is private and should require a github password and userid. Clone button is then clicked.
输入 URL 后,底部的按钮变为克隆。仅供参考 存储库是私有的,应该需要 github 密码和用户 ID。然后单击克隆按钮。
It asks where to save the file. I choose a location then it comes here:
它询问保存文件的位置。我选择一个位置然后它来到这里:
Always trust github.com is chosen as suggested in another post. Click Continue then get the following:
始终信任 github.com 按照另一篇文章中的建议选择。点击继续,然后得到以下信息:
At this point it has not asked me for my username or password at any time. Looking around here and on other sites it should ask for user id and password at this point but this is all I get. How can I get to the screen asking me to enter my Github user id and password when cloning a private repository on github.com in xcode?
在这一点上,它在任何时候都没有询问我的用户名或密码。环顾这里和其他网站,此时它应该要求输入用户 ID 和密码,但这就是我得到的全部。在 xcode 中克隆 github.com 上的私有存储库时,如何进入要求我输入 Github 用户 ID 和密码的屏幕?
采纳答案by smDeveloper
This is a glitch in xCode. You will have to install git and repair/prepare the repository from the git command line or another git tool then reopen the project in xCode and then it will be recognized.
这是 xCode 中的一个小故障。您必须从 git 命令行或其他 git 工具安装 git 并修复/准备存储库,然后在 xCode 中重新打开项目,然后它将被识别。
xCode is great for git when it works but will break sometimes and need manual repair/tweaking of a repository outside of xCode. You should think of the git features of xCode as a great aid to using git but not a complete interface replacement.
xCode 在 git 工作时非常适合,但有时会中断,需要手动修复/调整 xCode 之外的存储库。你应该把 xCode 的 git 特性看作是使用 git 的一个很好的帮助,而不是一个完整的界面替换。
回答by Manab Kumar Mal
You can try that way:
你可以试试这样:
- Open
Terminal
application. - cd to your project directory. (
cd /your/project/directory
) - Write
git clone https/link/for/your/git
. - Put
password
for the git user. - It will start download on your project directory.
- 打开
Terminal
应用程序。 - cd 到您的项目目录。(
cd /your/project/directory
) - 写
git clone https/link/for/your/git
。 password
为 git 用户放置。- 它将在您的项目目录中开始下载。
回答by beporter
It seems to work using the [email protected]:user/repo.git
URL format if you have your public SSH key set up properly on your Mac(and the private key is not protected by a passphrase).
[email protected]:user/repo.git
如果您在 Mac 上正确设置了公共 SSH 密钥(并且私有密钥不受密码保护),它似乎可以使用URL 格式工作。
When xCode logs in via SSH to clone the repo, it will be able to do so without you having to provide any credentials. Note that this will probably only work where you have SSH (read/write) access to the repo in question. Since with Github you are likely to be forking another project and working on your own fork, this shouldn't be too much of an obstacle though.
当 xCode 通过 SSH 登录以克隆存储库时,您无需提供任何凭据就可以这样做。请注意,这可能仅适用于您对相关存储库具有 SSH(读/写)访问权限的情况。由于使用 Github,您可能会分叉另一个项目并在自己的分叉上工作,但这不应该是太大的障碍。