{"thread":{"id":"16748","subject":"Can I use git protocol to push change to remote repo?","startedAt":"2008-12-16T07:22:17Z","lastAt":"2008-12-16T08:59:16Z","messageCount":5,"participants":["Emily Ren","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"98046","messageId":"856bfe0e0812152322i3a7fa376h8a35466b7abf82a5@mail.gmail.com","threadId":"16748","inReplyTo":"856bfe0e0812152318h1375401fx944834ad6410835d@mail.gmail.com","subject":"Can I use git protocol to push change to remote repo?","fromName":"Emily Ren","fromEmail":"lingyan.ren@gmail.com","sentAt":"2008-12-16T07:22:17Z","receivedAt":"2008-12-16T07:22:17Z","isPatch":false,"sender":{"key":"lingyan.ren@gmail.com","avatar":null},"body":"Hello,\n\nI can clone a remote repo with git protocol, but I can't push my\nbranch to origin repo with git protocol. If I use ssh protocol, I can\npush sccuessfully. I'm confused, can someone give me a guide on this?\nCan I use git protocol to push my branch to remote repo? If yes, how\ncan I do ? Thank you for your help in advance !\n\nError info is as below:\n $ git push git://host.xz/testgit check_push\nfatal: The remote end hung up unexpectedly\nerror: failed to push to 'git://host.xz/testgit'\n\nSuccessful info with ssh protocol:\n$ git push ssh://host.xz/testgit check_push\nuser's password:\nupdating 'refs/heads/check_push'\n  from 0000000000000000000000000000000000000000\n  to   60719ede9ef5d5fdc042e7aebcebc04a93d3928a\nGenerating pack...\nDone counting 3 objects.\nDeltifying 3 objects...\n 100% (3/3) done\nWriting 3 objects...\n 100% (3/3) done\nTotal 3 (delta 0), reused 0 (delta 0)\n\nThanks,\nEmily\n"},{"id":"98048","messageId":"20081216073835.GA2468@coredump.intra.peff.net","threadId":"16748","inReplyTo":"856bfe0e0812152322i3a7fa376h8a35466b7abf82a5@mail.gmail.com","subject":"Re: Can I use git protocol to push change to remote repo?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-16T07:38:35Z","receivedAt":"2008-12-16T07:38:35Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Dec 16, 2008 at 03:22:17PM +0800, Emily Ren wrote:\n\n> I can clone a remote repo with git protocol, but I can't push my\n> branch to origin repo with git protocol. If I use ssh protocol, I can\n> push sccuessfully. I'm confused, can someone give me a guide on this?\n> Can I use git protocol to push my branch to remote repo? If yes, how\n> can I do ? Thank you for your help in advance !\n\nYes, git-daemon does not support pushing by default, since it doesn't do\nany authentication of the pushing users. The recommended practice is to\npush over ssh, which uses the exact same protocol, but is tunneled over\nssh, so the user is authenticated and the incoming data has an integrity\ncheck (note that pulling by ssh is also the same protocol as pulling via\ngit://, except of course that it is also tunneled over ssh; this means\nthat if you are pushing and pulling, you can just set your remote to\ntalk to the ssh version).\n\nIf you _really_ want totally anonymous, unsecured pushing to your repo\n(e.g., because you are on a restricted LAN and everybody is trusted),\nyou can enable the receive-pack service. See the git-daemon\ndocumentation for details.\n\n-Peff\n"},{"id":"98051","messageId":"856bfe0e0812160048l7d901658tca96f5055c69743c@mail.gmail.com","threadId":"16748","inReplyTo":"20081216073835.GA2468@coredump.intra.peff.net","subject":"Re: Can I use git protocol to push change to remote repo?","fromName":"Emily Ren","fromEmail":"lingyan.ren@gmail.com","sentAt":"2008-12-16T08:48:34Z","receivedAt":"2008-12-16T08:48:34Z","isPatch":false,"sender":{"key":"lingyan.ren@gmail.com","avatar":null},"body":"Peff,\n\nThank you for your help !  I read the git-daemon description, and\nadded following lines in the config file of remote repository.\n\n [daemon]\n       receivepack = true\n\nIt failed with another error, is there anything I missed to config daemon ?\n$ git push git://host.xz/testgit test_push2\nupdating 'refs/heads/test_push2'\n  from 0000000000000000000000000000000000000000\n  to   eebb60caae38a38361d002cdace043124a2fc871\nGenerating pack...\nDone counting 3 objects.\nDeltifying 3 objects...\n 100% (3/3) done\nWriting 3 objects...\n 100% (3/3) done\nTotal 3 (delta 0), reused 0 (delta 0)\nunpack unpacker exited with error code\nng refs/heads/test_push2 n/a (unpacker error)\nerror: failed to push to 'git://host.xz/testgit'\n\nThanks,\nEmily\n\nOn Tue, Dec 16, 2008 at 3:38 PM, Jeff King <peff@peff.net> wrote:\n> On Tue, Dec 16, 2008 at 03:22:17PM +0800, Emily Ren wrote:\n>\n>> I can clone a remote repo with git protocol, but I can't push my\n>> branch to origin repo with git protocol. If I use ssh protocol, I can\n>> push sccuessfully. I'm confused, can someone give me a guide on this?\n>> Can I use git protocol to push my branch to remote repo? If yes, how\n>> can I do ? Thank you for your help in advance !\n>\n> Yes, git-daemon does not support pushing by default, since it doesn't do\n> any authentication of the pushing users. The recommended practice is to\n> push over ssh, which uses the exact same protocol, but is tunneled over\n> ssh, so the user is authenticated and the incoming data has an integrity\n> check (note that pulling by ssh is also the same protocol as pulling via\n> git://, except of course that it is also tunneled over ssh; this means\n> that if you are pushing and pulling, you can just set your remote to\n> talk to the ssh version).\n>\n> If you _really_ want totally anonymous, unsecured pushing to your repo\n> (e.g., because you are on a restricted LAN and everybody is trusted),\n> you can enable the receive-pack service. See the git-daemon\n> documentation for details.\n>\n> -Peff\n>\n"},{"id":"98053","messageId":"20081216085205.GB3031@coredump.intra.peff.net","threadId":"16748","inReplyTo":"856bfe0e0812160048l7d901658tca96f5055c69743c@mail.gmail.com","subject":"Re: Can I use git protocol to push change to remote repo?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-16T08:52:05Z","receivedAt":"2008-12-16T08:52:05Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Dec 16, 2008 at 04:48:34PM +0800, Emily Ren wrote:\n\n> It failed with another error, is there anything I missed to config daemon ?\n> $ git push git://host.xz/testgit test_push2\n> updating 'refs/heads/test_push2'\n>   from 0000000000000000000000000000000000000000\n>   to   eebb60caae38a38361d002cdace043124a2fc871\n> Generating pack...\n> Done counting 3 objects.\n> Deltifying 3 objects...\n>  100% (3/3) done\n> Writing 3 objects...\n>  100% (3/3) done\n> Total 3 (delta 0), reused 0 (delta 0)\n> unpack unpacker exited with error code\n> ng refs/heads/test_push2 n/a (unpacker error)\n> error: failed to push to 'git://host.xz/testgit'\n\nDoes the user running git-daemon have permissions to write to the repo?\n\n-Peff\n"},{"id":"98055","messageId":"856bfe0e0812160059k102cd6a7k8d551f9d20010d62@mail.gmail.com","threadId":"16748","inReplyTo":"20081216085205.GB3031@coredump.intra.peff.net","subject":"Re: Can I use git protocol to push change to remote repo?","fromName":"Emily Ren","fromEmail":"lingyan.ren@gmail.com","sentAt":"2008-12-16T08:59:16Z","receivedAt":"2008-12-16T08:59:16Z","isPatch":false,"sender":{"key":"lingyan.ren@gmail.com","avatar":null},"body":"Peff,\n\nYes, you are  right !  I changed the permission of the repo, and it's OK now. :)\n\nThank you very much for your kindly help !\n\nEmily\n\nOn Tue, Dec 16, 2008 at 4:52 PM, Jeff King <peff@peff.net> wrote:\n> On Tue, Dec 16, 2008 at 04:48:34PM +0800, Emily Ren wrote:\n>\n>> It failed with another error, is there anything I missed to config daemon ?\n>> $ git push git://host.xz/testgit test_push2\n>> updating 'refs/heads/test_push2'\n>>   from 0000000000000000000000000000000000000000\n>>   to   eebb60caae38a38361d002cdace043124a2fc871\n>> Generating pack...\n>> Done counting 3 objects.\n>> Deltifying 3 objects...\n>>  100% (3/3) done\n>> Writing 3 objects...\n>>  100% (3/3) done\n>> Total 3 (delta 0), reused 0 (delta 0)\n>> unpack unpacker exited with error code\n>> ng refs/heads/test_push2 n/a (unpacker error)\n>> error: failed to push to 'git://host.xz/testgit'\n>\n> Does the user running git-daemon have permissions to write to the repo?\n>\n> -Peff\n>\n"}]}