A little script to help you rename your repos' branch name from master
to main
and set it as the default branch in github.
But why ๐ฉ? Check this Twitter thread
Inspired by this post
- curl
- jq
Create a Github Personal Access Token
Then execute the following in your terminal
export GH_USERNAME=your-username
export GH_TOKEN=the-token-above
./rename.sh
If you have more than 30 repos you will need to adjust the pagination accordingly.