How to manage a project on GitHub that has an external git dependency not stored on GitHub

I am working on a project that I would like to keep on GitHub.

This project uses mupdf, which is hosted on its own git server, for example. git: //git.ghostscript.com/mupdf.git

I want to be able to get the latest changes from mupdf, but also save the changes that I make to mupdf, saving my entire project on GitHub.

My first thought was to add mupdf as a submodule and then push my project on GitHub - but what happens to the changes I make to mupdf (for example, inside a submodule)? Where do I keep them? My understanding was that if I make changes inside the submodule, the commit would only be stored locally there. I read this page http://git-scm.com/book/en/Git-Tools-Submodules , but was not sure if this would work.

What is the best way to set up my repo so that:

1) My whole project is on GitHub 2) I can get new changes from mupdf in my project 3) I can save my changes in mupdf and combine them with new changes

+4
source share
2 answers

You can also push the submodule repository to github. If you want this to be the default location of the repo, do the configuration in the .gitmodules file in the root of your working folder. Then do

 git submodule init 

to distribute the new url to .git/config in the submodule.

+1
source

You will need to either make changes to another git repository (where it can be saved), or create a fork for this repository in GitHub and make your changes there.

+1
source

All Articles