• Local GitHub Config

    defunkt 10 Oct 2008

    With awesome tools like GitNub and GitX adding GitHub integration, it would be great if you didn’t have to keep re-entering you username and API token.

    So let’s settle on a standard, pioneered by GitNub:

    $ git config --global github.user defunkt
    $ git config --global github.token 6ef8395fecf207165f1a82178ae1b984
    

    (Remember to replace defunkt and <a href="http://github.com/6ef8395fecf207165f1a82178ae1b984">6ef8395fecf207165f1a82178ae1b984</a> with your own username and token.)

    Applications and scripts can easily access this information:

    $ git config --global github.user
    defunkt
    

    You can also access ~/.gitconfig directly.

    I just pushed out new versions of my gist script and the gist.el mode which use this method. Check the code for examples in Ruby and Emacs Lisp.

    If you’re a developer, please adopt this method of storing GitHub data. Your users will thank you!

  • Comments

    mislav Sat Oct 11 12:15:03 -0700 2008

    +1. let’s standardize this!

    pieter Sat Oct 11 14:38:16 -0700 2008

    so, who sends in a patch for GitX? :)

    pieter Mon Oct 13 16:18:18 -0700 2008

    I caved in and did it myself. This is in the latest GitX nightly with the gistie paste stuff.

    ivey Wed Oct 15 12:23:36 -0700 2008

    You should put those two lines on the account page, for easy copy/paste.

    defunkt Wed Oct 22 17:01:05 -0700 2008

    @ivey nice idea, this’ll happen in the next push

    gcb Fri Feb 20 06:39:57 -0800 2009

    $ git config—global github.user me $ git config—global github.token mytoken $ git push origin master Permission denied (publickey). fatal: The remote end hung up unexpectedly

    what did i miss?

    gcb Fri Feb 20 06:41:39 -0800 2009

    nice! comments screw up dash dash and no line breaks. just perfect for the kind of content you guys serve…

    Please log in to comment.