我正在尝试向不同的存储库中添加一个Git子模块。我创建了我想要的存储库,但是子模块是由我的顾问创建的。
为了方便起见,假设我试图添加的子模块是存储库A,而我试图将其添加到存储库B。
几个注意事项:
这是我正在采取的步骤,以添加A到B,以及相应的终端输出。
In: git submodule add git@gitlab.com:Respository_B上面的行工作得很好,我可以在.gitmodules文件中看到正确的信息,这是输出:
[submodule "Repository_B"]
path = repository_B
url = git@gitlab.com:Repsitory_B现在,我尝试了以下两件事:
In: git submodule init
Out: fatal: No url found for submodule path 'submodule_A' in .gitmodules和,
In: git submodule update --remote
Out: setsockopt IPV6_TCLASS 8: Operation not permitted: 我很困惑。我试着在网上寻找解决方案,但空手而归。有什么办法解决这个问题吗?
另外,如果我需要澄清什么,请告诉我。
谢谢!
编辑
我认为只要读子系统存在一些chmod问题,所以我尝试了这一行,得到了另一条错误消息。
In: sudo git submodule update --remote
Out: git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Unable to fetch in submodule path 'Repository_A'这很奇怪,因为我可以使用创建到本地克隆的符号链接访问存储库。
发布于 2020-04-13 16:29:10
我正在尝试添加存储库A,而我试图将其添加到存储库B中。
然后命令是:
cd /path/to/B
git submodule add git@gitlab.com:Respository_A
git commit -m "Add A to B"
git push关于错误消息,本期建议:
我们使用的一个解决方法是在~/..ssh/config中放置以下行: AddressFamily瓦内 注意:如果要连接到一个AddressFamily主机,那么使用IPv4内很好。如果主机仅为IPv6,则根本不会连接。
https://stackoverflow.com/questions/61192074
复制相似问题