Today someone in the Azure DevOps Club slack asked a question about finding the repo from the default wiki in Azure DevOps. This used to be available if you knew what to do, so you could clone the repo and add pages programmatically for example. Weirdly enough, we couldn’t find how to get the repo to be visual so we could use it. In this case, the person asking the question wanted to add branch policies on the wiki repo so they can enforce Pull Requests on incoming changes. Of course, I was intrigued and started to search: this functionality was always there before, so surely this will still be available?
Short version: it is not available anywhere, but you can ‘guess’ the correct URL and clone it:
git clone https://dev.azure.com/<organization>/<project>/_git/<name of wiki>.wiki
In Azure DevOps there is a distinction between two ways to setup your wiki:
If you created a wiki a couple of years ago, you have the first wiki type. You could get the git URL to clone the repo and when you made changes to it, the repository would become visible on the Repos overview. This is no longer the case.
Currently when you create a new team project, you get the option to choose between the two types, although it is not very clear to see the difference between the two.
When you create a new project and navigate to the wiki page, you are now greeted with this screen. Already confusing and the Learn more link tries to make the difference more clear, but doesn’t really make it clear it will always be a repo underneath.
I mean, if you need this large a matrix to try and make the differences clear, while under the covers it is the same setup, why not make your product easier to use?
Testing things out, I created a new team project [Demo] and created a new project wiki for it. Then I started searching for the wiki in the repos overview, but it only shows the default, empty project repository, not the wiki repo:
If you go to the wiki, it shows the name of the wiki:
Even the dropdown or extra button (the three dots) doesn’t some more information. You can find the git URL for cloning you need, but not how to get to the repository to set up branch policies for example…
Azure DevOps has an awesome REST API you can use to automate almost everything in Azure DevOps, so let’s see what it returns.
If you update the URL in your browser, you can test the API with normal GET request without setting up to much stuff. Go to https://dev.azure.com/raj-bos/Demo/_apis/git/repositories
(so organization/project/_apis/git/repositories) and you get a list of repositories.
If you include the query string includeHidden=True
as can be found in the API docs, you see that the wiki repo is visible:
Conclusion: it is a repo, but a hidden one!
I’ve searched and tested some options, but I didn’t manage to update the repo and make it not hidden anymore.
Finding some really old posts and a GitHub issue that requested the hidden repo to be visible (that got redirected to a UserVoice request that was closed due to inactivity 😧), I figured that this old URL might still be working… And luckily it is!
If you check the name of your wiki repository, you can enter it in the URL of a normal repository (use the repo selection dropdown first for the correct URL to appear for easy changing):
https://dev.azure.com/<organization>/<project>/_git/<name of wiki>.wiki
The most amazing part: the UI will now remember the last repo you have viewed, so if you use the menu to navigate to branches, it will enable you to set branch policies. You can add the repo to the URL here by hand as well of course, if need be.
Hopefully the Azure DevOps team improves on this omission (in my opinion) soon.
So, in conclusion: if you can’t find the wiki repo in Azure DevOps, you now have a way to get to it, even when the UI doesn’t give you an option for it.