Skip to content

This script goes through all GitHub repos that you own (that are not forks) and renames any branches named "master" to a new name (defaults to release).

Notifications You must be signed in to change notification settings

krusynth/branchrename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

branchrename

This script goes through all GitHub repos that you own (that are not forks) and renames any branches named master to a new name (defaults to release).

Note: this process will update all repos effected. As a result, these will appear at the beginning of your GitHub repositories list, and any configured hooks (CI, etc.) will be triggered.

Usage:

  1. Create an auth token for GitHub, with the repo privileges enabled.

  2. Rename settings.example.py to settings.py and paste your token. You can also customize the new branch name here.

  3. Install the dependencies: pip3 install -r requirements.txt

  4. Run the script: python3 branchrename.py

  5. 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

About

This script goes through all GitHub repos that you own (that are not forks) and renames any branches named "master" to a new name (defaults to release).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages