Fork Git repo via Azure DevOps REST API

Pieter Gheysens
Into ALM
Published in
Mar 15, 2022

Lately I have been mostly using the az devops cli to streamline some activities in Azure DevOps. To my surprise it wasn’t possible to fork a Git Repo via the az devops cli and the way to fork a repo via the REST API was also a bit cumbersome. That’s why I wanted to document here for further reference.

Photo by David Beneš on Unsplash

To fork the repo you have the use the Respositories — Create API call and pass the details of the involved repo in the body of the request.

The sample in the official documentation didn’t quite work and I noticed that the repo id and project id are required to pass the request.

--

--

Pieter Gheysens
Into ALM

Visual Studio ALM MVP — Managing Director Xpirit Belgium (2018) — Founder of Techorama (2014) — www.techorama.bewww.xpirit.com