eclipse - 克隆一个有子模块的 git repo

标签 eclipse git git-submodules

我有一个包含子模块的 git repot。

我想将这个 repo 克隆到一个 eclipse 工作区中,我已经读过这个

Working with Submodules

You can read more about what Git submodules are and how they work in this Git Community Book chapter.
Cloning Repositories with Submodules
Submodules are repositories nested inside a parent repository.
Therefore when doing a clone of a parent repository it is necessary to clone the submodule repositories so that the files/folders are available in the parent repository's working directory.

Checking the Clone Submodules button from the Git Clone wizard will clone all submodule repositories after the clone of the parent repository finishes.

enter image description here

但是,当我完成克隆时,子模块目录是空的 并且该项目没有出现在工作区中。

如何添加子模块?

最佳答案

在eclipse中进入git explorer视角

你可以在你的项目下导入你的项目模块

project> working directory > select sub module > import project.
  >> Import as general project (for new)
  >> Import existing project (which will replace you current project)

如果您有 3 个模块,则需要一个一个地导入。作为现有模块或新模块

关于eclipse - 克隆一个有子模块的 git repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25781339/

相关文章:

用于将白标签实例部署到不同子域的 Git 策略。

eclipse - 如何将Eclipse从2018-09更新到2018-12

java - 如何从android库类中调用方法

git - SSH 到 Openshift 服务器失败

Git:如何交换本地和远程的 2 个分支 (Github)

Git 丢弃工作目录子模块中的更改

git - 是否可以将 git 子模块连接到主项目分支上的特定提交?

Eclipse自动完成功能已损坏

java - eclipse 。手动运行测试并使用 "maven install"后的不同行为

Github 提交(推送) Gist