How can I add submodules to my own repository?

lonelyadmin
lonelyadmin
Even after all these years of using it, I still consider myself a git noob. I don't usually do anything too complex, but I recently just started using submodules. I have my own repo that I use locally, hosted on a linux box over ssh. I have added other people's repos to my own using: [CODE] git clone ssh://myserver/localrepo.git cd ./localrepo git clone https://github.com/foo/foo.git git submodule add https://github.com/foo/foo.git foo [/CODE] I'd like to be able to merge any changes from the submodules original repo with my own and add those to my own local repo. I used to do this manually by copying the files into my local repo and adding them...which is the process I'm trying to replace. When I try to add these submodules, they are empty in my master repo...they still expect to fetch/pull from their original repo. I'm obviously doing it wrong. How would I go about still tracking the changes from the original repo, merging with my own, and updating only my local repo?

Last updated

DougR
DougR
Rather than reproduce something already written - see here: [URL]https://www.atlassian.com/git/tutorials/git-submodule[/URL]

1-2 of 2

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply
512 views