Skip to content

Instantly share code, notes, and snippets.

@topfunky
Created June 9, 2011 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save topfunky/1016906 to your computer and use it in GitHub Desktop.
Save topfunky/1016906 to your computer and use it in GitHub Desktop.
Create a new git repository on a remote server. Assumes that you're sitting in an initialized Git repo.
function new-git () {
ssh git@example.com "mkdir $1.git && cd $1.git && git --bare init"
git remote add origin git@example.com:$1.git
git push origin master
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
git config push.default current
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment