忽略只能通过 VPN 访问的 git 子模块
我正在 git 修订控制下工作一个项目,这不是我的项目,但我可以对其进行读/写访问。因此,我可以更改 .gitmodules 文件的修订控制下的内容,但存在将更改提交到 git 存储库的风险。
它在 .gitmodules 文件中列出了两个 git 子模块,其中一个只能通过 VPN 访问,另一个可以通过公共 Internet 访问。
在初始拉取后更新我的子模块时,我将无法访问 VPN 网络:
git submodule update
拉取将失败:
$ git submodule update
Cloning into subproject...
ssh: connect to host blah.example.com port 22: Connection refused
fatal: The remote end hung up unexpectedly
Clone of '[email protected]:project/subproject.git' into submodule path 'subproject' failed
此后我也将无法访问。
我不想修改 .gitmodules 文件以删除有问题的子模块,并冒着稍后提交我的文件版本的风险,也不想全局忽略 .gitmodules 文件。
我想做的是如何忽略这个子模块,同时仍然下拉开放互联网上可访问的子模块,完成我的工作并提交我的更改。在我勾选的限制条件下,我该如何做到这一点?
I'm working a project under git revision control that is not my project, but I have r/w access to it. So, I can change what is under revision control in regards to the .gitmodules file, but risk committing the change to the git repository.
It has two git submodules listed in .gitmodules file, one of which is only accessible via a VPN, and the other is accessible over the public Internet.
I will not have access to the VPN network when updating my submodules after the initial pull via:
git submodule update
The pull will fail:
$ git submodule update
Cloning into subproject...
ssh: connect to host blah.example.com port 22: Connection refused
fatal: The remote end hung up unexpectedly
Clone of '[email protected]:project/subproject.git' into submodule path 'subproject' failed
Nor will I have access anytime afterward.
I don't want to have modify the .gitmodules file stripping out the offending submodule and risk committing my version of the file at later date, nor do I want to globally ignore .gitmodules files.
What I'd like to do is some how ignore this submodule, while still pulling down the submodule accessible on the open Internet, do my work, and commit my changes. How do I do that with in the constraints I ticked off?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论