Announcement

Collapse
No announcement yet.

How can I add submodules to my own repository?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I add submodules to my own repository?

    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
    <now git push/pull/fetch/commit still references https://github.com/foo/foo.git>
    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?

  • #2
    Rather than reproduce something already written - see here: https://www.atlassian.com/git/tutorials/git-submodule

    Comment

    Working...
    X