title | description |
---|---|
Renaming master branches to main |
a CLI to manage applications deployed to Kubernetes |
A list of repositories that are not software services or not connected / automatically hooked with software services and therefor could easily be changing the main branch name to 'main':
- README ✅
- potential ✅
- artsy.github.io (contacted @pepopowitz)
- clouds (not sure about any references pointing to master)
- minotaur ✅
- infrastructure
- ops-util
- cli
- antigravity
- arrow
- codemods
- substance
- integrity
- peril-settings
- renovate-config
- next
- docker-images
- kubernetes-node-doktor
- homebrew-formulas
- artsy-hokusai-templates
- orbs
- lattice ✅
A list of artsy gems and libraries that might be loaded into gemfiles with referring to the master branch.
- watt
- omniauth-artsy
- estella
- crispr
- money_helper
- delta
⚠️ seems more complex though - gravitype
- day-schedule-selector
Projects that use hokusai for automated deployments but not mission-critical to the Artsy ecosystem:
Make sure that after the renaming process the PRs are still open and now pointing to main.
Search the repository for any references to the old master
branch name and update them to use main
, especially:
- Continuous integration steps configured in
.circleci/config.yml
- Any set-up instructions or scripts
Create a pull request with these changes (e.g.), and monitor that they build and deploy to staging successfully.
Make sure you are on your local master branch and also pulled the latest changes.
Because on Github you probably configured the master
branch as the default branch. To configure the main branch
as default, go to the settings/branches and change the default branch to main.
Now every team member needs to update their local default branch. This is what you can see on GitHub once the master branch is renamed. You can copy the commands from the section Team Duties after rename below. There are two options listed, a complicated and an easier way 😄.
The complicated way:
# Switch to the "master" branch:
$ git checkout master
# Rename it to "main":
$ git branch -m master main
# Get the latest commits (and branches!) from the remote:
$ git fetch origin
# Create a new tracking connection with the new "origin/main" branch:
$ git branch -u origin/main main
# Reset the remote head to main:
$ git remote set-head origin -a
The easy way:
# fetch main
$ git fetch origin main
# get the remote main branch and check it out locally
$ git checkout main
# delete local master branch
$ git branch -D master
If the project's release pipeline is automated with Horizon, edit the project's "stages":
- Login to https://releases.artsy.net/admin/projects
- Find the project in Horizon's project list, click "edit."
- Click "stages" to list the stages and "edit" to edit the
master
branch. - Update the name and branch fields to be
main
as mentioned in the doc. - Click
Update
to save.
Since we haver external tools that are not possible to map by checking the repository code itself, this is something we need to consider as a Team duties after rename as well. Well known tools that are not easy to map:
- Jenkins
- Airflow