在本地克隆 Git 存储库 [英] Cloning Git repository locally

查看:39
本文介绍了在本地克隆 Git 存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在 iMac 上的用户 git 帐户下创建了一个 git 存储库,现在我想从同一台计算机上的主用户帐户克隆它.我已经创建了我的 SSH 密钥并将其添加到 .ssh/authorized_keys 文件中.但是,当我使用主帐户重新登录时,收到以下错误消息:

<块引用>

权限被拒绝(公钥)致命:远端意外挂断

现在对我来说,在网上搜索时,我的公钥似乎不正确.我已经创建了两次,但仍然遇到同样的问题.

解决方案

您根本不需要 ssh 密钥.使所有文件都可读,只需克隆完整路径即可.换句话说,做

<前>$ git clone/path/to/repo

I have just create a git repository on my iMac under the user git account and am now want to clone it from my main user account on the same computer. I have created my SSH key and added it to the .ssh/authorized_keys file. However when I log back in with my main account I get the following error message:

Permission denied (publickey) fatal: The remote end hung up unexpectedly

Now to me, and while searching on the web it seems like my public key is incorrect. I have created it twice and still get the same issue.

解决方案

You shouldn't need an ssh key at all. Make all of the files world readable and just clone the full path. In other words, do

$ git clone /path/to/repo

这篇关于在本地克隆 Git 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆