Git — Repo inside your repo?
Introduced git-submodule
2 min readJan 23, 2017
If you came across adding your sub-directory as an individual repo, you might be interested on using git-submodule commands.
There’s three ways I will cover in this articles:
- Using GitKraken Ways
- Command-line Savvy
- Manual *Advanced, to understand what each commands does
1. GitKraken
2. Command-line Savvy
- https://chrisjean.com/git-submodules-adding-using-removing-and-updating/
- http://blogs.atlassian.com/2013/03/git-submodules-workflows-tips/
- https://github.com/blog/2104-working-with-submodules
- https://gist.github.com/gitaarik/8735255
- add submodule from existing directory https://stackoverflow.com/a/36389987/3763032
3. Manual
- Edit your main repo .git/config
- Edit / create your main.gitmodules files
- Edit / create your sub-repo .git/config
Troubleshooting
Update your submodule from fresh clone
Happy, coding guys!!!