Created
June 7, 2013 08:01
-
-
Save zwacky/5727710 to your computer and use it in GitHub Desktop.
creates a bare git repository with two branches (master, develop) in it, ready to be commited onto.
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 | |
# shell script to create git repositories | |
if [ $# -ne 1 ] ; then | |
echo "usage: create-git REPONAME" | |
echo "=> example: create-git myrepo" | |
exit | |
fi | |
cd ~/git | |
git init --bare $1.git | |
git clone ~/git/$1.git ~/temp/$1 | |
cd ~/temp/$1 | |
git commit --allow-empty -m "initial commit" | |
git push origin master | |
git checkout -b develop | |
git push -u origin develop | |
cd ~ | |
rm -rf ~/temp/$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment