- Run
trunkify.sh <GH_username>
to rename the master branch of all repos in a directory. - You need to update the default branch for each repo on GitHub (follow urls printed out).
First download the .trunkify.sh
script and place it in a folder that has git repo(s) in it (e.g. your projects/
folder, NOT in a Git repo itself).
Run from bash with ./trunkify.sh <GH_username>
. Username is optional, but will give you links to update your GitHub default branch. The script will rename the master branch in each git repo it encounters to trunk. No pull requests, no messing with Git history.
Renames master
to trunk
by default, but you can specify an optional second parameter to rename master
to something else (ex. ./trunkify.sh <GH_username> main
). Other good names are main
, latest
, default
, etc.
All credit to Scott Hanselman, see his blog post here for why I used git branch -m
and further instructions on how to tell others to update their local repositories.
This comes with no warranties! Use at own risk.