Skip to content

Instantly share code, notes, and snippets.

@philtr
Created February 9, 2012 16:20
Show Gist options
  • Save philtr/1780887 to your computer and use it in GitHub Desktop.
Save philtr/1780887 to your computer and use it in GitHub Desktop.
Shell function for creating a new empty branch
# Add this to your .zshrc or .bash_profile
# Usage: gneb BRANCH_NAME
#
function gneb {
git symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -fdx
touch README.md
git add README.md
git commit -m 'Initial commit'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment