Git:更新子模块时输入用户名(Git: Enter username when updating submodules)

编程入门 行业动态 更新时间:2024-10-25 22:33:12
Git:更新子模块时输入用户名(Git: Enter username when updating submodules)

我正在与另一个名为B的人合作,他在我们的git存储库中添加了一个子模块。 当我想更新它时,我看到了.gitmodules:

[submodule "mod"] path = mod url = https://B@serverurl/path/modr.git

我可以将此文件修改为myname@serverurl ,提交并推送它,运行git submodule sync ,但它非常愚蠢。 我不能只是将用户名留空并每次输入用户名吗?

谢谢。

I'm cooperating with another one called B, and he adds a submodule to our git repository. When I want to update it, I see this .gitmodules:

[submodule "mod"] path = mod url = https://B@serverurl/path/modr.git

I can modify this file to myname@serverurl, commit and push it, run git submodule sync, but it's incredibly stupid. Can't I just leave the username blank and input username each time?

Thanks.

最满意答案

url中的用户名是可选的。 您可以指示每个开发人员不要在.gitmodules中签入他们的用户名,而是通过其他方式指定。 例如,可以使用.netrc文件提供用户名。

Username in url is optional. You can instruct each developer NOT to check in their username in .gitmodules and specify it via other means instead. E.g., username can be provided using .netrc file.

更多推荐

本文发布于:2023-08-03 16:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1393532.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:输入用户名   模块   Git   Enter   submodules

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!