0.3.0 • Published 4 years ago
revert-to-master v0.3.0
revert-to-master
Rename your default Git branch from main to master.
This script requires that you have a GitHub authorization token. As well, if you have branch protections enabled for master
, consider turning them off so that the script can remove the branch from your remote repo.
Install
$ npm install -g revert-to-master
Usage
$ revert-to-master
OPTIONS
-b, --branch=branch [default: master] The branch name to create
-h, --help show CLI help
-v, --version show CLI version
What is this doing?
git checkout -b master main
: Create a branchmaster
frommain
git push origin master
: Push thatmaster
branch to your remote- Using the GitHub API's Update a repository endpoint, set
master
as the new default branch git branch -D main
: Removesmain
from your local machinegit push origin :main
: Removesmain
from your remote repositoryNote: this step will fail if branch protections are enabled
If you have core.defaultBranch
set, the script will use that branch name as its default.
0.3.0
4 years ago