Warning
This document has not been updated for a while now. It may be out of date.
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
.
- Rename the
master
branch in GitHub tomain
for that repo. See instructions from Github for renaming an existing default branch. - 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
.
- Set the Jenkins build number (the last
master
build +1). - 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). - Switch your local branch, otherwise you might rebase the wrong branch by mistake!
- Update the list of apps on the Trello card
Additional things to check
- Update references in Jenkins to pulling down the
master
branch of the app. See example. - Update the Pact tests to run against the
main
branch- There are various places where we reference a
master
branch in the Pact tests. We’ll need to remember to update these as we go through the various apps. Examples: - collections
- gds-api-adapters
- There are various places where we reference a