Reputation: 358
Hello i am looking for a way to add my submodules to my github repo for example
iris
https://github.com/kataras/iris
I tried
git add *
git add .
and then committing and pushing but the folder stay empty (greyed out)
The reason I want to add these submodules is because I want to deploy my application on heroku.
But since the submodules do not get uploaded into my github repo I can not deploy my heroku application since it is missing them from my github repository.
Any ideas on how to add these submodules to my repo would be much appreciated.
Upvotes: 6
Views: 11537
Reputation: 5261
Are you really sure you need to use git submodule for your use case? I would suggest that you consider git subtree instead. From experience with using both in conjunction with repos deployed to Heroku, I can tell you that git subtree is FAR easier to work with long term.
Upvotes: 2
Reputation: 1329322
If you add a nested git repo, you will get a gray folder (gitlink) without being able to retrieve its content.
You need to:
git rm --cached nested_repo_root_folder
(no trailing slash)Then, you can add back that nested repo as a full-fledged submodule:
git submodule add -- /url/nested/repo
Upvotes: 1
Reputation: 9616
The command to add submodule is
git submodule add <your another repo url>
Refer to git-submodule
Upvotes: 9