Skip to content

Instantly share code, notes, and snippets.

@topfunky
Created July 25, 2011 22:23
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save topfunky/1105392 to your computer and use it in GitHub Desktop.
Save topfunky/1105392 to your computer and use it in GitHub Desktop.
Shell shortcut to setup a Git repo with GitHub. Works with zsh or bash.
# Usage: new-github topfunky tidy_table
function new-github() {
git remote add origin git@github.com:$1/$2.git
git push origin master
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
git config push.default current
}
@doppler
Copy link

doppler commented Jul 26, 2011

git push -u origin master # pretty much does the remaining 3 lines for you

@rgabo
Copy link

rgabo commented Jul 26, 2011

$ brew install hub
$ mkdir foobar; cd foobar
$ git init; hub create
Initialized empty Git repository in /Users/rgabo/Code/sandbox/foobar/.git/
Updating origin
created repository: rgabo/foobar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment