Create a clean, orphan Git branch that is not based on
main
ormaster
. Ideal for versioned branches, independent histories, or diverging development lines.
- 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)
Install globally using NPM:
npm install -g git-newroot
git-newroot [branch-name]
If no branch name is provided, it defaults to: version-1
git-newroot version-2
This will:
-
Create a new orphan branch named version-2
-
Delete all tracked files
-
Create a README.md file
-
Commit the file
-
Push to origin/version-2 (if a remote is set)
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.)
Created and Maintained by: Ethern-Myth
Give a like to this project and let's share it and spread it more. Thanks.