az repos ref

Manage Git references.

Commands

az repos ref create

Create a reference.

az repos ref delete

Delete a reference.

az repos ref list

List the references.

az repos ref lock

Lock a reference.

az repos ref unlock

Unlock a reference.

az repos ref create

Create a reference.

az repos ref create --name
                    --object-id
                    [--detect {false, true}]
                    [--org]
                    [--project]
                    [--repository]

Required Parameters

--name

Name of the reference to create (example: heads/my_branch or tags/my_tag).

--object-id

Id of the object to create the reference from.

Optional Parameters

--detect

Automatically detect organization.

accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

--repository -r

Name or ID of the repository.

az repos ref delete

Delete a reference.

az repos ref delete --name
                    --object-id
                    [--detect {false, true}]
                    [--org]
                    [--project]
                    [--repository]

Required Parameters

--name

Name of the reference to delete (example: heads/my_branch).

--object-id

Id of the reference to delete.

Optional Parameters

--detect

Automatically detect organization.

accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

--repository -r

Name or ID of the repository.

az repos ref list

List the references.

az repos ref list [--detect {false, true}]
                  [--filter]
                  [--org]
                  [--project]
                  [--repository]

Optional Parameters

--detect

Automatically detect organization.

accepted values: false, true
--filter

A filter to apply to the refs (starts with). Example: head or heads/ for the branches.

--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

--repository -r

Name or ID of the repository.

az repos ref lock

Lock a reference.

az repos ref lock --name
                  [--detect {false, true}]
                  [--org]
                  [--project]
                  [--repository]

Required Parameters

--name

Name of the reference to update (example: heads/my_branch).

Optional Parameters

--detect

Automatically detect organization.

accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

--repository -r

Name or ID of the repository.

az repos ref unlock

Unlock a reference.

az repos ref unlock --name
                    [--detect {false, true}]
                    [--org]
                    [--project]
                    [--repository]

Required Parameters

--name

Name of the reference to update (example: heads/my_branch).

Optional Parameters

--detect

Automatically detect organization.

accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

--repository -r

Name or ID of the repository.