Azure / Azure/azure-cli

The `az repos create` command does not respect the default branch name setting in the ADO portal.

Open
#27,306 3 comments 0 reactions 0 assignees View on GitHub
act-platform-engineering-squad Auto-Assign Auto-Resolve customer-reported DevOps question Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

The `az repos create` command does not respect the default branch name setting in the ADO portal.

### Related command

az repos create

### Errors

N/A

### Issue script & Debug output

N/A

### Expected behavior

Running `az repos create` should create a repo with a default branch using the name set in the ADO portal.

### Environment Summary

azure-cli 2.42.0 *

core 2.42.0 *
telemetry 1.0.8 *

Extensions:
application-insights 0.1.19
azure-devops 0.26.0
containerapp 0.3.16
log-analytics 0.2.2
logic 0.1.6
resource-graph 2.1.0

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\...\.azure\cliextensions'

Python (Windows) 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:37:59) [MSC v.1933 32 bit (Intel)]

### Additional context

We have the option set in ADO for default branches to be named "main". When I create a new repo via `az repos create --name foo`, a repo does get created but with a default "master" branch.

Also, I don't see a CLI option to set which branch name to use when creating the repo. I'm not interested in creating one with master, then creating main, then changing the default to main, if that is even possible via the CLI...

Also also, I tried upgrading viz `az upgrade`, which uses Python, which launched an MSI, which couldn't complete because Python was running. lol

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.