Monday, 27 July 2020

Git Repo Submodule Checkout in Azure DevOps Build Pipelines

Submodule in Git repos help you to keep the common code modules in a separate repo and utilize in multiple other repos. When you clone the git repo you can include submodules by using git clone --recurse-submodules. In Azure pipelines you can enable checking out the code with submodules for build and package purpose. Let’s have a look at the settings to enable submodule checkout in builds.

In the build, when you select an Azure Git repo you get the option to enable checkout submodules. It can be set recursive to checkout all nested submodules to checkout only the top-level submodule.

You get this option to checkout submodules in all Git based repos that can be used with Axure pipelines such as BitBucket, GitHub and other Git repos.

In YAML pipelines the syntax would be to use as shown below to checkout top-level submodules.

- checkout: self

submodules: true

To recursively checkout all nested submodules you can use the syntax below.

- checkout: self

submodules: recursive

No comments:

Popular Posts