git子模块使用不同的ssh密钥? [英] Git submodule using a different ssh key?

查看:105
本文介绍了git子模块使用不同的ssh密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将私有存储库添加为git子模块.

I'm trying to add a private repository as a git submodule.

我可以像git clone <repo_url>这样克隆存储库,但是当我使用git submodule add <repo_url> <folder_destination>时,我会回来:

I can clone the repository like so git clone <repo_url> but when I use git submodule add <repo_url> <folder_destination> I get back:

权限被拒绝(公钥).致命的:无法从远程读取 存储库.

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

请确保您具有正确的访问权限和存储库 存在.

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

推荐答案

由于某些原因,我的.git/modules文件夹的所有权已更改为root.

For some reason the ownership on my .git/modules folder had changed to root.

我能够通过运行以下内容解决此问题:

I was able to fix the issue by running:

chown -R philip:philip .git/modules/

这篇关于git子模块使用不同的ssh密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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