Home > Blockchain >  Cannot open git submodule folder on GitHub online
Cannot open git submodule folder on GitHub online

Time:12-29

I recently added 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 answer and it says that both the name and the commit hash should appear as links but that does not seem to be the case for me. I directly cloned the submodule repo into my project, so I had to first do git rm --cached catkin_ws/src/turtlebot3_simulations/ and then execute git submodule add https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/noetic-devel catkin_ws/src/turtlebot3_simulations/ to add the submodule. This is my first time using submodules and I am not sure what I am doing wrong. Looking for any kind of hints on what I did wrong and what is the correct way to fix this. Thank you!

CodePudding user response:

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. To fix your problem remove the wrong submodule and re-add the correct one:

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/
  • Related