【问题标题】:Cannot open git submodule folder on GitHub online无法在线打开 GitHub 上的 git 子模块文件夹
【发布时间】:2022-01-26 19:23:36
【问题描述】:

我最近在我的项目 repo 中添加了 this github repo 作为子模块。我无法在我的项目 repo here 中打开 repo 的根文件夹。我查看了this 的答案,它说名称和提交哈希都应该显示为链接,但对我来说似乎并非如此。我直接将子模块repo克隆到我的项目中,所以我必须先执行git rm --cached catkin_ws/src/turtlebot3_simulations/然后执行git submodule add https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/noetic-devel catkin_ws/src/turtlebot3_simulations/来添加子模块。这是我第一次使用子模块,我不确定我做错了什么。寻找有关我做错了什么以及解决此问题的正确方法的任何提示。谢谢!

【问题讨论】:

    标签: git github git-submodules


    【解决方案1】:

    https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/noetic-devel 不是存储库,因此不能作为子模块添加。这是一个分支 noetic-devel 在 repo https://github.com/ROBOTIS-GIT/turtlebot3_simulations 内。要解决您的问题,请删除错误的子模块并重新添加正确的子模块:

    git submodule deinit -f -- catkin_ws/src/turtlebot3_simulations/
    git rm --cached catkin_ws/src/turtlebot3_simulations/
    git submodule add -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations catkin_ws/src/turtlebot3_simulations/
    

    【讨论】:

    • 谢谢。在运行第一个命令之前,我还必须从本地存储库中删除整个子模块文件夹。之后,我运行了第一个和第二个命令,重新克隆了子模块 repo,然后执行了命令 3。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-08
    • 2018-05-17
    • 1970-01-01
    相关资源
    最近更新 更多