Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ghostbar
Created October 20, 2009 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghostbar/213924 to your computer and use it in GitHub Desktop.
Save ghostbar/213924 to your computer and use it in GitHub Desktop.
creates a git empty branch
#!/bin/sh
# creating a git empty branch
# it takes as arg the name for the new branch
git-symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -fdx
git commit --allow-empty -m "Initial empty branch commit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment