1

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!

1 Answers1

1

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/
phd
  • 82,685
  • 13
  • 120
  • 165
  • Thanks. I additionally had to delete the entire sub module folder from my local repository before running the first command. After doing that, I ran the first and second commands, re-cloned the submodule repo and then executed command 3. – Speedracer1702 Dec 28 '21 at 13:57
  • https://stackoverflow.com/help/someone-answers – phd Dec 28 '21 at 15:23