Setup

Tool: Renaming Script

Reference: 

Case Study:

https://github.com/kelynch/branch-renaming-test

Ran:

# set up test repo at ~/code/branch-renaming-test
git clone https://gist.githubusercontent.com/escowles/eed4567d818f77811311386df8e71133
# move the script and make it executable
mv eed4567d818f77811311386df8e71133/rename-master-to-main.sh ~/code/hold/rename.sh
cd ~/code/hold/
chmod 755 rename.sh 
# export your GitHub token
echo $GITHUB_TOKEN=xyz
./rename.sh kelynch branch-renaming-test
git fetch 
git branch -d master
# remote branch cannot be deleted before protection rules are updated

Checklist:

Locations text "master" still exists (mostly found via github search):

Evaluation:

This script provides a quick and easy interface to replace "master" with "main" on a GitHub repository and update the local to "main."  It is intentionally conservative in its approach and does not delete branches on the local or remote, so all removal of "master" should be done manually.  This script may be especially useful when used with GitHub's upcoming seamless transition tooling.