Skip to content

Instantly share code, notes, and snippets.

@zwacky
Created June 7, 2013 08:01
Show Gist options
  • Save zwacky/5727710 to your computer and use it in GitHub Desktop.
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.
#!/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