简体   繁体   English

来自服务器的 git clone(使用 ssh)

[英]git clone from a server (using ssh)

My friend created a server and I tried to get the repository on local machine using this command:我的朋友创建了一个服务器,我尝试使用以下命令在本地机器上获取存储库:

git clone ssh://git@abc.com:10022/aaa/bbb.git

However, I get this error message:但是,我收到此错误消息:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

and then he told me to login the git and give me: user name , email and password .然后他告诉我登录git并给我: user nameemailpassword

How can I login the git?我如何登录git? Thank you very much.非常感谢。

To clone anything from git, you have to register on github/gitlab (depending where your friend has his git repo), then generate ssh key on your laptop/computer, like described here: https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent .要从 git 克隆任何内容,您必须在 github/gitlab 上注册(取决于您朋友的 git 存储库在哪里),然后在您的笔记本电脑/计算机上生成 ssh 密钥,如下所述: https : //help.github.com/en /github/authenticating-to-github/generate-a-new-ssh-key-and-adding-it-to-the-ssh-agent Add public ssh key into your account on github/gitlab (depending where your friend has his git repo).将公共 ssh 密钥添加到您在 github/gitlab 上的帐户中(取决于您朋友的 git 存储库在哪里)。 And as a last step - to configure your git on laptop/computer:最后一步 - 在笔记本电脑/计算机上配置您的 git:

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

Here is more information: https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup以下是更多信息: https : //git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM