Socket
Book a DemoInstallSign in
Socket

no-more-masters

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

no-more-masters

Rename your default Git branch from master to main

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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?

  • git checkout -b main master: Create a branch main from master

  • git push origin main: Push that main branch to your remote

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

  • git branch -D master: Removes master from your local machine

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

Keywords

blm

FAQs

Package last updated on 11 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts