This script goes through all repo that you own on GitHub that are not forks and renames any branches named master
to a new name (defaults to release
).
Usage:
-
Create an auth token for GitHub, with the
repo
privileges enabled. -
Rename
settings.example.py
tosettings.py
. Enter the token and your user or organization. You can customize the new branch name. -
Install the dependencies:
pip3 install -r requirements.txt
-
Run the script:
python3 branchrename.py
-
After you've run this script, you'll need to rename any repos that are checked out locally. Run this command from the directory of any repo you have checked out locally to rename the branch and track from origin.
git checkout master && git fetch && git branch -m release && git branch release -u origin/release