- Add the repo as a git submodule
git submodule add <url>
- Initialize and update the submodule to the latest changes
git submodule init
git submodule update
# this will fetch and merge the lates changes from remote repo
git submodule update --remote --merge
- Commit the newly added
.gitmodules
and arepo_name.diff
- To update in future follow commands from step 2
Relavent link on SO