• Supercharged git-daemon

    mojombo 13 Jul 2008

    Over the past several weeks I’ve been working on a secret Erlang project that will allow us to grow GitHub in new and novel ways. The project is called egitd and is a replacement for the stock git-daemon that ships with git. If you’re not familiar, git-daemon is what has, until today, served all anonymous requests for git repositories. Any time you used a command like git clone git://github.com/user/repo.git you were being served those files by git-daemon.

    The reason we need egitd is for flexibility and power. We need the flexibility to map the repo name that you specify on the command line to any disk location we choose. git-daemon is very strict about the file system mappings that you are allowed to do. We also need it so that we can distinguish and log first-time clones of repos. Keep an eye out (down the road) for statistics that show you exactly how many times your public repo has been cloned!

    Another benefit of coding our own git server is enhanced error messages. I can’t even begin to tell you how many people have come to us complaining about the following error which is caused by trying to push to the public clone address:

    fatal: The remote end hung up unexpectedly 

    With egitd we can inject reasonable error responses into the response instead of just closing the connection and leaving the user bewildered. Behold!

    fatal: protocol error: expected sha/ref, got '
    *********'
    
    You can't push to git://github.com/user/repo.git
    Use git"github":http://github.com/github.com:user/repo.git
    
    *********'

    Still a little crufty, but until we can get something useful into core git, it’s the best we can do and should help many people as they learn git and get over some of the confusing aspects.

  • Comments

    drnic Mon Jul 14 04:06:51 -0700 2008

    So if we combine your hidden statistics and your configurable error messages, one day I might see something like the following:

    fatal: protocol error: expected sha/ref, got '
    *********'
    
    You can't push to git://github.com/user/repo.git
    Use git@github.com:user/repo.git
    
    This is the 13th time you have made this error. 
    You are now ranked: A tool.
    
    *********'
    defunkt Mon Jul 14 04:37:37 -0700 2008

    @drnic Who told you we were planning that?

    davidhq Mon Jul 14 15:26:03 -0700 2008

    Wow!

    topfunky Mon Jul 14 16:59:36 -0700 2008

    So now we need new categories on Working with Rails:

    • Most Cloned
    • Biggest Tool According to Github
    defunkt Mon Jul 14 18:05:07 -0700 2008

    We already have a “Biggest Tool” award, but I don’t think the winners’ names will be leaving our Campfire.

    skwp Tue Jul 22 13:37:11 -0700 2008

    Awesome! Github itself is an awesome humane interface on top of git (whose cli ui leaves a lot to be desired from a usability standpoint). Fixing up the daemon to be more humane is the missing key. Major kudos.

    jwinter Sun Oct 19 18:26:10 -0700 2008

    If you found this page because you were googling for the error above, you can fix it by editing the url field in .git/config to what the error message says: git@github.com:user/repo.git.

    markatharvest Wed Nov 12 14:09:54 -0800 2008

    I am a newbie to git, I installed git on my windows using Cygwin, and successfuly uploaded git files to git hub repository. Now when I try to do the same, with other windows machine, it gives me the errror you mentioned above Here are my commands >git config — user.email ‘mark@gmail.com’ > git add HELLO > git commit – m ‘second commit’ >git status //shows the status as clean >git remote add origin git@github.com:mark/website.git falta : remote origin already exists >git push origin master // And I get the following error fatal: protocol error: expected sha/ref, got ’ *********’ You can’t push to git://github.com/user/repo.git Use git@github.com:user/repo.git

    I have created the public key and added to the github, but using the same userName and email in global config, is that the error or some else.

    Thanks in advance

    brondsem Tue Dec 02 21:51:02 -0800 2008

    Try: > git remote rm origin > git remote add origin git@github.com:username/project.git

    I got some errors in output when I did the ‘rm’ and then later when I did the push, but it seemed to work anyway

    balepc Sun Dec 07 12:10:44 -0800 2008

    > fatal: protocol error: expected sha/ref, got ‘

    The following error is caused by wrong repository cloning. On your project page there are two links, one is public and the other one is for contributors: Public Clone URL: git://github.com/xxx/yyy.git Your Clone URL: git@github.com:xxx/yyy.git So use the second one.

    PaulSnow Tue Jun 16 10:29:04 -0700 2009

    I appreciate the Comments.... I will admit to being a "cookbook" git user .... look up commands for what I want to do... But using git too infrequently to master all the kinks and turns...

    I ran into this error. And I searched to find how to deal with it.

    I found the original article really ... funny? Is that the word? .... since he managed to insult those new to git who get this error message, implying that they [a group that includes myself] are tools, as they [like myself] thrash about with this error without understanding what it suggests. And yet the author never bothers to actually explain what they [again, including myself] are supposed to do about it.

    Seriously.

    What a tool (and I don't mean us newbie users....)

    Thankfully, those that comment are not so blind as to why people might end up here, and provided the little hints required to properly use the information provided by the message to solve the problem, i.e. "editing the url field in .git/config " as jwinter pointed out.

    PaulSnow Tue Jun 16 10:32:20 -0700 2009

    Opps. The "tool" guy was the first commenter.... my mistake. However, criticism that that the article lacks any description of what to do, but rather concentrates on describing the implementation details of the problem still stands.

    georgechemy Wed Jul 29 06:29:16 -0700 2009

    With the growing popularity of dynamic languages such as Lisp, Python dedicated server, and the .NET Framework’s upcoming release of its Dynamic Language Runtime (DLR), we’re taking another step of neoteny. Instead of a compiler generating instruction byte codes, a “compiler for any dynamic language implemented on top of the DLR has to generate DLR abstract trees, and hand it over to the DLR libraries” (per Wikipedia). These abstract syntax trees (AST), normally an intermediate artifact created deep within the bowels of a traditional compiler online marketing (and eventually discarded), are now persisted as compiler output.

    harikt Sun Sep 20 10:24:49 -0700 2009

    @brondsem You are right
    $ git remote rm origin $ git remote add origin git@github.com:username/project.git I did and i am successfully pushing it .
    Its great man .
    @mojombo Please edit the post and add this as one solution . Thanks

    markweee Thu Oct 01 02:35:00 -0700 2009

    The federal government of Brazil is well known for its support for Linux.News of the Russian military creating their own Linux distribution has also surfaced.Indian state of Kerala has gone so far as to make it mandatory for all state high schools to run Linux on their computers online associate Degree AND online Bachelor Degree

    markweee Thu Oct 01 02:35:20 -0700 2009

    We also need it so that we can distinguish and log first-time clones of repos. Keep an eye out (down the road) for statistics that show you exactly how many times your public repo has been cloned! doctoral degree AND online Master Degree AND distance learning university

    Ninanina Sun Oct 18 20:42:43 -0700 2009

    I never used a public repo because it is easy to be cloned. Just don't want to pay money for such risks. It is easy to get cloned, and I would better hire someone to do it, lol. free classifieds |part time jobs |bathroom vanity

    AJHEELS Thu Oct 29 14:42:05 -0700 2009

    For information and products relating to height increase or footcare please visit HEELSNCLEAVAGE
    Thats great, Ive messed around with Zookeeper a few times
    HEEL PADS
    SHOE INSOLE
    INCREASE MY HEIGHT
    INCREASE YOUR HEIGHT

    Duffy9 Mon Nov 02 02:52:02 -0800 2009
    MelisaP Tue Nov 03 03:56:53 -0800 2009

    Wonderful post!!!! games

    Please log in to comment.