Skip to content

Ethern-Myth/git-newroot-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ฆ git-newroot

Create a clean, orphan Git branch that is not based on main or master. Ideal for versioned branches, independent histories, or diverging development lines.

npm downloads


NPM


๐Ÿš€ Features

  • Creates a completely independent Git branch
  • Starts with a clean history (no parent)
  • Adds a simple README.md to initialize the branch
  • Optionally pushes the branch to origin
  • Cross-platform: Linux, macOS, Windows (via Git Bash)

๐Ÿ› ๏ธ Installation

Install globally using NPM:

npm install -g git-newroot

โš™๏ธ Usage

git-newroot [branch-name]

If no branch name is provided, it defaults to: version-1

๐Ÿ” Example:

git-newroot version-2

This will:

  1. Create a new orphan branch named version-2

  2. Delete all tracked files

  3. Create a README.md file

  4. Commit the file

  5. Push to origin/version-2 (if a remote is set)

๐Ÿง  Whatโ€™s an Orphan Branch?

An orphan branch is a Git branch that starts with no commit history โ€” it's not based on any existing branch like main.

Perfect for:

  • Generating release snapshots

  • Starting over clean

  • Building demo repos

  • Static deployment branches (gh-pages, etc.)

Author

Created and Maintained by: Ethern-Myth


Give a like to this project and let's share it and spread it more. Thanks.

About

Create a clean, orphan Git branch that is not based on main or master branch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published