1

I have added submodule to my project, I have added my file to it, then I have done commit. What I have to do now? I can't push changes because that submodule repository is not my, I haven't password from it, etc. Is it possible to push changes in submodule to my server?

Ildar
  • 798
  • 2
  • 14
  • 35
  • what do you mean by "added submodule to my project" , you cloned it from remote repository ?? – saurav Aug 21 '13 at 06:19
  • Yes, I cloned it from remote repository. I clicked in smartgit "submodule->add" and entered remote repository url – Ildar Aug 21 '13 at 06:21
  • 1
    might be this question can help you - http://stackoverflow.com/questions/8372625/git-how-to-push-submodule-to-a-remote-repository – saurav Aug 21 '13 at 06:46

1 Answers1

1

You can't update submodule source on server by simple push. Possible way to do this:

  1. fork your submodule project (if license allow it)
  2. push in that fork your changes
  3. update submodule url to new fork repository.You can do this by editing .gitmodules file:

    [submodule "lib/Example"]
        path = lib/Example
        url = ../Example.git  # <-- here insert link to your fork
    

    Doing this in future you must update your fork manually, periodically doing pulls from upstream (original submodule project) repository

  4. finally do git submodule update
Alexander Yancharuk
  • 13,817
  • 5
  • 55
  • 55