Create empty git branches

Create empty branch with:

Sometimes you only want to transfer an artifact or some logs between strongly restricted environments and don’t want your git repo to balloon over time by accumulating countless big data blobs in its index.

Create an empty throw-away branch that is not forked from existing branches like this:

git checkout --orphan <branchname>
git reset --hard

Delete historic branches with:

Then delete them once they are no longer needed:

git branch -D <branchname>