如何将GIT subsodule添加到父仓库的特定分支?

发布于 2025-02-03 03:31:43 字数 292 浏览 2 评论 0原文

假设我有一个有两个分支的存储库:main功能。现在,我希望我的功能分支将另一个存储库作为子模块,但我希望该子模块仅在该功能分支分支不到main 分支。 我已经尝试过:

  1. 切换到功能分支
  2. 将我的子模块添加
  3. 回到main分支,但是这里的子模块仍然可见,我不想要。

怎么可能?

Say i have a repo that has two branches: main and feature. Now i want my feature branch to depend on another repo as a submodule but i want that submodule to be visible only to that feature branch not to the main branch.
I have already tried:

  1. switch to feature branch
  2. add my submodule there
  3. switch back to main branch, but here the submodule remains visible which i don't want.

How is it possible ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文