Skip to content

Instantly share code, notes, and snippets.

View deflexable's full-sized avatar

Anthony deflexable

View GitHub Profile
@deflexable
deflexable / Git: Empty branch.md
Created February 21, 2022 10:22 — forked from blattmann/Git: Empty branch.md
Git: Create empty branch

Replace empty-branch with your desired branch name.

git checkout --orphan empty-branch

Then you can remove all the files you'll have in the staging area (so that they don't get committed):

git rm -rf .

At this point you have an empty branch, on your machine.