Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Jul 26, 2011

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

@rgabo

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.