Created
January 26, 2011 13:57
-
-
Save nu7hatch/796713 to your computer and use it in GitHub Desktop.
Create empty git branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -gt 0 ]; then | |
git symbolic-ref HEAD refs/heads/$1 && | |
rm .git/index && | |
git clean -fdx && | |
git commit --allow-empty -m "Created empty $1 branch" | |
else | |
echo "No branch name specified!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment