通过https更新Git子模块 [英] Git Submodule update over https

查看:114
本文介绍了通过https更新Git子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我坐在只允许http / https通信的代理服务器上,我可以从Github克隆一个存储库,但我必须使用https URL和用户名/密码来获取/推送。

现在我的问题是一个有子模块的存储库,当我执行 git submodule update 超时时,我可以只是假设这是因为它使用了被阻止的SSH连接。 (它甚至不会要求我在私人回购站上输入密码)

解决方案

在您的 .gitmodules 文件放置在您的仓库的根目录中,并在 .git / config 文件中,您应该为您的子模块找到一个部分。您可以在那里编辑url,以便通过https请求而不是ssh访问。



当然,它可能已经是ssh url,在这种情况下,问题可能是其他问题,但这是第一个检查的地方。


I am sitting on a proxy which only allows http/https traffic only, I am able to clone a repository from Github, but I have to fetch/push using the https URL and username/password.

Now my issues is a repository with submodules, when I execute git submodule update it times out, and I can only assume this is because it's using an SSH connection which is blocked. (it doesn't even ask me for a password on private repos)

解决方案

In your .gitmodules file in the root of your repo, and in the .git/config file, you should find a section for your submodule. You can edit the url there so it is accessed via https request rather ssh.

Of course it may already be an ssh url, in which case the problem may be something else, but this is the first place to check.

这篇关于通过https更新Git子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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