Skip to main content

Command Palette

Search for a command to run...

Worked example - Editing an Azure DevOps wiki locally

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

Published
1 min read
Worked example - Editing an Azure DevOps wiki locally

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!

Worked examples

Part 8 of 12

Descriptions of how specific situations have unfolded in real-world programming I've done. Aims to provide insights into the reality of a programmer's work and learn lessons from these occasions.

Up next

Worked example - Reversing the order of lines of text in a file

How the need to convert a script for creating database views into a script to drop them led me to a useful powershell snippet

More from this blog

T

Tim talks tech

76 posts