--- layout: post title: Removing master references from github repositories date: 2020-06-15 10:24 author: rick categories: --- I recently [found out](https://twitter.com/natfriedman/status/1271253144442253312) the term 'master' as repository name is considered offensive, since it is often used in conjunction with the term 'slave' Which in hindsight is indeed [not correct to use](https://en.wikipedia.org/notes/Master/slave_(technology)#Terminology_concerns). Since it is not technology limiting how a branch is named, changing is just a matter of making of spending some time on it. If I can make the world a better place by renaming a few of repository trees, it's time well spend. Since FreeBSD and subversion is using the word [trunk](https://en.wikipedia.org/notes/Trunk_%28software%29) together with branches for ages, so I thought it would make a much better alternative. Switching is a semi-easy, first create and new branch: ``` $ git checkout -b trunk Switched to a new branch 'trunk' $ git push -u origin trunk Total 0 (delta 0), reused 0 (delta 0) remote: remote: Create a pull request for 'trunk' on GitHub by visiting: remote: https://github.com/rickvanderzwet/nagios-plugins/pull/new/trunk remote: To https://github.com/rickvanderzwet/nagios-plugins.git * [new branch] trunk -> trunk Branch 'trunk' set up to track remote branch 'trunk' from 'origin'. ``` Deleting old branch: ``` $ git push origin --delete master To https://github.com/rickvanderzwet/nagios-plugins.git ! [remote rejected] master (refusing to delete the current branch: refs/heads/master) error: failed to push some refs to 'https://github.com/rickvanderzwet/nagios-plugins.git' ``` Whoops make sure to change the GitHub default branch, in mine case found at: > https://github.com/rickvanderzwet/nagios-plugins/branches And try again: ``` $ git push origin --delete master To https://github.com/rickvanderzwet/nagios-plugins.git - [deleted] master # Delete local branch: $ git branch -d master Deleted branch master (was 82e57d4d). # Update head reference pointer: $ git remote set-head origin trunk ```