0.3.0 • Published 5 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-masterUsage
$ revert-to-master
OPTIONS
-b, --branch=branch [default: master] The branch name to create
-h, --help show CLI help
-v, --version show CLI versionWhat is this doing?
git checkout -b master main: Create a branchmasterfrommaingit push origin master: Push thatmasterbranch to your remote- Using the GitHub API's Update a repository endpoint, set
masteras the new default branch git branch -D main: Removesmainfrom your local machinegit push origin :main: Removesmainfrom 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
5 years ago