All Projects → gjtorikian → no-more-masters

gjtorikian / no-more-masters

Licence: Unlicense license
Rename your default Git branch from master to production

Programming Languages

javascript
184084 projects - #8 most used programming language
Batchfile
5799 projects

Projects that are alternatives of or similar to no-more-masters

gitnim
choosenim for choosey nimions
Stars: ✭ 18 (-33.33%)
Mutual labels:  branches
branch-names
Github action to retrieve branch or tag names with support for all events.
Stars: ✭ 99 (+266.67%)
Mutual labels:  branches
awesome-accomplice
A list of resources for folks ready to join the path to Racial Justice
Stars: ✭ 35 (+29.63%)
Mutual labels:  anti-racist
branch-switcher
a GitHub bot that switches the base branch of pull requests to the preferred branch
Stars: ✭ 15 (-44.44%)
Mutual labels:  branches
automate-branch-rules-cli
The tool lets you automate the addition, removal or alteration of the branch protection rules for 1 or more branches & repositories in one go.
Stars: ✭ 29 (+7.41%)
Mutual labels:  branches
donations
Grounding corporate donations in the reality of the individual
Stars: ✭ 17 (-37.04%)
Mutual labels:  blm
git-explode
Explode linear sequence of git commits into topic branches
Stars: ✭ 43 (+59.26%)
Mutual labels:  branches
git-bonsai
Tend the branches of your git garden
Stars: ✭ 15 (-44.44%)
Mutual labels:  branches

no-more-masters

Rename your default Git branch from master to main.

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 no-more-masters

Usage

$ no-more-masters

OPTIONS
  -b, --branch=branch  [default: main] The branch name to create
  -h, --help           show CLI help
  -v, --version        show CLI version

What is this doing?

  1. git checkout -b main master: Create a branch main from master

  2. git push origin main: Push that main branch to your remote

  3. Using the GitHub API's Update a repository endpoint, set main as the new default branch

  4. git branch -D master: Removes master from your local machine

  5. git push origin :master: Removes master from your remote repository

    Note: this step will fail if branch protections are enabled

Configuration

If you have core.defaultBranch set, the script will use that branch name as its default.

A GitHub API token can also be provided via the GITHUB_TOKEN environment variable.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].