Skip to content

Bash script to mass migrate branches on github (like master -> main)

License

Notifications You must be signed in to change notification settings

ReifyAB/migrate_branches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

migrate_branches

Small bash script to quickly migrate branches on github.

By using the github REST API, the script will list all the repos that are still using the old branch name and rename it for each of them.

It was written to ease migration from master to main branch.

By doing it that way, it will also make sure that:

  • default branch is updated
  • users get a notice on the repo about the name change
  • github pages setup are updated if based on the old branch name

usage

GITHUB_TOKEN=xxxx \
OWNER=Jell \
SOURCE_BRANCH=master \
TARGET_BRANCH=main \
./migrate_branches.sh

About

Bash script to mass migrate branches on github (like master -> main)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages