Forum Discussion
Auto create 3 branches when a repository is created in Azure DevOps Git
Hi Lance,
There's no built-in feature to automatically create Azure DevOps repositories with 3 default branches. However, you can implement ways to achieve what you want such as an automated process to create Git repos with default branches as you've mentioned.
I would take it a step further by creating a "Template Repository". This template repository is a repository in Azure DevOps and has the three git branches (dev, release and hotfix). If you want you can add a specific folder structure or have an initial project setup so the developers can start right away. Your Azure Pipeline would roughly look something like this:
1. Checkout template repository
2. Create the requested Azure DevOps repository
3. Do a checkout of the created repository
4. Set the remote origin to the remote Azure DevOps repository url
5. Run the pipeline through the Azure DevOps GUI, via the REST API or other tooling 😉
Let me know if this helps you and if you have any questions, let me know!