简体   繁体   中英

Link two github repos

I want to make an opensource project. I also have private parts of the app I thought in making 2 github repos and link them togther one is public and has the base code and the other one is private and dependent on the first.

I also want the dependent one to update as soon as I commit a change to the open source repo and define which parts of the project to be updated automatically

Is there a better alternate to my idea? How could I achieve such result?

Repo 2 depends on Repo 1, so you should have Repo 1 setup as a submodule in Repo 2.

I don't know if you can set behaviors to pull the changes to Repo 1 immediately, but it'd be something like:

cd ~/path/to/repo2
git submodule add https://url/to/repo1
git submodule update --init --recursive

Any time Repo 1 makes changes, you can

git pull

and then update the submodules

git submodule update --init --recursive

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM