简体   繁体   中英

Push multiple Git repositories to one repository

I'm not sure if this is even possible. However, let me ask.

Can I push from multiple repos to a single repo? Essentially, I want the single repo to contain files from all the smaller repos.

I have repos created for various modules of my project. And the single repo is essentially the project itself.

As twalberg noted above, you can push from multiple repositories into a single destination, but that will create distinct history graphs. You can merge them though and even in keep sync with Git's help using what is call in Git a Subtree Merge, as described in http://git-scm.com/book/ch6-7.html . Take a look.

I suppose you are trying to implement SVN workflow but it is not possible with git.

There are two suitable approaches:

  1. If your project is going to be loose coupled with your modules — use separate repository for your modules, and install it as a separate python packages (usual plugin system, like django plugins).
  2. Otherwise — use a single repository for project and modules.

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