How can I set git config --global init.defaultBranch main during the FETCHSOURCE step in google cloud build?
The mission is silencing this redundant message:
hint: Using 'master' as the name for the initial branch. This
default branch name hint: is subject to change. To configure the
initial branch name to use in all hint: of your new repositories,
which will suppress this warning, call: hint: hint: git config
--global init.defaultBranch <name>
I've tried this in step 0 of cloudbuild.yaml but it runs after FETCHSOURCE
steps:
- name: 'gcr.io/cloud-builders/git' args: [ 'config', '--global', 'init.defaultBranch', 'master']