我如何用子模块克隆git分支?

发布于 2025-01-26 07:53:44 字数 370 浏览 3 评论 0原文

我有一个称为a(不是主分支)的分支,有一些文件和一个subpoule。我想将此类模块克隆到我的本地存储库中,但我不知道该怎么办。

我尝试了一些命令,但它们仅克隆文件和文件夹。他们仅复制子模块的文件夹,除了其中的文件和文件夹。

这是我尝试过的一些命令,但它们没有起作用。

git clone --recurse-submodules -b week3 --single-branch git://github.com/foo/bar.git
git clone -b week3 --single-branch git://github.com/foo/bar.git

如何克隆特定分支(不是主要)的subsodule到我的本地计算机?

I have a branch called A (not main branch) and there's some files and one submodule. I want to clone this submodule to my local repository but I don't know how to.

I tried some commands but they only cloned files and folders. They only copy the folder of the submodule, except the files and folders inside it.

Here are some commands I tried but they didn't work.

git clone --recurse-submodules -b week3 --single-branch git://github.com/foo/bar.git
git clone -b week3 --single-branch git://github.com/foo/bar.git

How can I clone a submodule in a specific branch(not main) to my local computer?

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

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

发布评论

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