Fork Git repo via Azure DevOps REST API
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.
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.