无法在线打开 GitHub 上的 git 子模块文件夹

Cannot open git submodule folder on GitHub online

我最近添加了 this github repo as a submodule in my project repo. I cannot open the root folder of the repo in my project repo here. I looked at 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/ 来添加子模块。这是我第一次使用子模块,我不确定自己做错了什么。寻找有关我做错了什么的任何提示以及解决此问题的正确方法。谢谢!

https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/noetic-devel is not a repository and hence cannot be added as a submodule. It's a branch noetic-devel inside 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/