Set a default branch for content deployment

You can specify a default branch that code management can use if it can't deploy the specified ref, tag, commit, or branch.

Before you begin: You can't use :default_branch by itself. This option can only be used in conjunction with :ref, :tag, :commit, or :branch, which are used to Keep repository content at a specific version .
In the Puppetfile, in the content declaration, set the :default_branch option to the branch you want to deploy if your specified option fails. For example, this declaration tracks the :control_branch and uses the main branch as a backup if no matching branch is found.
mod 'hieradata',
     :git    => 'git@git.example.com:organization/hieradata.git',
     :branch => :control_branch,
     :default_branch => 'main'
Specifying a :default_branch is recommended when you Declare content from a relative control repo branch, in case code management can't find a matching branch.

If r10k can't parse the default branch specification or no such named branch exists, it logs an error and does not deploy or update the content.