简体   繁体   English

将git repo与子模块合并以掌握

[英]Merging git repo with submodules to master

I have a microservice type application made up of 10+ microservices. 我有一个由10多个微服务组成的微服务类型应用程序。 Currently all services exist in one git repo, but this is starting to prove unmanageable because our build/release pipelines are taking a long time to complete because a single change to one of the services triggers the single build for the entire repo. 当前,所有服务都存在于一个git repo中,但这已开始变得难以管理,因为我们的构建/发布管道需要很长时间才能完成,因为对其中一项服务的单一更改会触发整个repo的单一构建。

I'm considering using git submodules to manage this process (so I can create build/release pipelines for each submodule), but unsure of the pull-request process. 我正在考虑使用git子模块来管理此过程(因此我可以为每个子模块创建构建/发布管道),但是不确定请求请求的过程。 If I have a repo called Develop with 10 submodules (1 for each microservice) and another repo called master (also with 10 submodules). 如果我有一个名为Develop的存储库,它带有10个子模块(每个微服务1个)和另一个称为master的存储库(也带有10个子模块)。 When I create a pull request from develop to master would I be able to do this once at the parent level (so develop to master), or would I need to create a separate pull request for each submodule that has changes? 当我创建从develop到master的拉取请求时,是否能够在父级上执行一次(这样开发到master),还是需要为每个有更改的子模块创建一个单独的pull请求?

You can create a pull request at the parent using this 您可以使用此方法在父级上创建拉取请求

git submodule update --recursive --remote

It will automaticaly pull your submodules, the same way you would do a git pull for each. 它将自动拉出您的子模块,就像您对每个子模块执行git pull

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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