Worked example - Editing an Azure DevOps wiki locally

A gotcha that I ran into while updating an Azure DevOps wiki

Worked example - Editing an Azure DevOps wiki locally

Photo by Yancy Min on Unsplash

All wikis in an Azure DevOps project are stored as git repositories. I wanted to use Find and Replace to make an update across many files, but this isn't possible through the Azure DevOps web UI. I cloned the repository locally, made my change, and committed it. That's when I ran into an interesting gotcha.

The branch which is used to display the wiki is not called master. It's called wikiMaster. I didn't think to check this, and pushed my changes to origin/master (creating the branch in the process thanks to a nifty git alias I use for pushing changes, as I usually do want to create a branch if it doesn't already exist).

Once I realised the branch name was wrong, the fix was simple:

  • I checked out the correct branch:
git checkout wikiMaster
  • I merged in my changes:
git merge master
  • I pushed the wikiMaster branch:
git push
  • I deleted the branch I'd unintentionally created on the server:
git push -d origin master

Job done!