Skip to main content
Last updated: 20 Apr 2021

How to switch a Git default branch from master to main

These steps are for switching the default branch of a repo to main.

  1. Rename the master branch in GitHub to main for that repo. See instructions from Github for renaming an existing default branch.
  2. Update the Release app:
    • Go to the app entry from the listing.
    • Hit the Edit tab.
    • Switch under the dropdown for GitHub repository default branch.
  3. Set the Jenkins build number (the last master build +1).
  4. Rebuild the latest main branch build which would have started automatically by Jenkins when the branch was renamed, but with the incorrect build number (and therefore is likely to have failed).
  5. Switch your local branch, otherwise you might rebase the wrong branch by mistake!
  6. Update the list of apps on the Trello card

Additional things to check