Created
November 12, 2009 22:44
-
-
Save bpo/233385 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Initialize a new completely empty branch. | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 <NEW_BRANCH>" | |
exit 1 | |
fi | |
if [ -a $1 ]; then | |
echo "Error: file $1 exists locally." | |
exit 1 | |
fi | |
mkdir $1 | |
cd $1 | |
git init | |
git commit --allow-empty -m "Initializing empty branch $1" | |
git push .. HEAD:$1 | |
cd .. | |
rm -fR $1 | |
echo "Empty branch $1 created." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment