{"thread":{"id":"11223","subject":"\"remote end hung up unexpectedly\"","startedAt":"2007-12-10T11:49:48Z","lastAt":"2007-12-11T07:15:56Z","messageCount":4,"participants":["Clifford Heath","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"62566","messageId":"CE1FB037-26E3-475E-9F9D-AC3874987B9C@gmail.com","threadId":"11223","inReplyTo":null,"subject":"\"remote end hung up unexpectedly\"","fromName":"Clifford Heath","fromEmail":"clifford.heath@gmail.com","sentAt":"2007-12-10T11:49:48Z","receivedAt":"2007-12-10T11:49:48Z","isPatch":false,"sender":{"key":"clifford.heath@gmail.com","avatar":null},"body":"Be patient with me, it's my first day on git... I like it better than  \nsvn already,\nbut I need a bit of help.\n\nAfter cloning a remote repository, I wanted to update (rebase) an  \nexisting\nremote branch to get the latest master commits, so I switched to it  \nusing\ngit checkout, then did a \"git merge origin/master\" and it updated my  \nlocal\ncopy so it looked reasonable... I have changes to add to this branch,  \nbut\nI wanted a proper base, so I did a \"git commit\" and a \"git push\". The  \npush\ngave me the above message.\n\nI've checked ssh access (don't have shell) to the other side, my PK  \nis set up.\n\nWhat went wrong? How can I diagnose it further (-v doesn't help)\n\nI understand that to add my further changes, I should set up a local  \nbranch\nto track this updated remote branch. But I'm assuming that the rebase  \nmust\nbe done while switched to the remote branch...?\n\nClifford Heath.\n"},{"id":"62572","messageId":"475D3AF9.60402@op5.se","threadId":"11223","inReplyTo":"CE1FB037-26E3-475E-9F9D-AC3874987B9C@gmail.com","subject":"Re: \"remote end hung up unexpectedly\"","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-12-10T13:11:21Z","receivedAt":"2007-12-10T13:11:21Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Clifford Heath wrote:\n> Be patient with me, it's my first day on git... I like it better than \n> svn already,\n\nWelcome to a better world.\n\n> but I need a bit of help.\n> \n> After cloning a remote repository, I wanted to update (rebase) an existing\n> remote branch to get the latest master commits, so I switched to it using\n> git checkout, then did a \"git merge origin/master\" and it updated my local\n> copy so it looked reasonable... I have changes to add to this branch, but\n> I wanted a proper base, so I did a \"git commit\" and a \"git push\". The push\n> gave me the above message.\n> \n> I've checked ssh access (don't have shell) to the other side, my PK is \n> set up.\n> \n> What went wrong? How can I diagnose it further (-v doesn't help)\n> \n\nHow did you clone it? If you cloned via git:// protocol, you most likely\ncan't push back there. The git-daemon supports pushing, but does no\nauthentication.\n\nIf you cloned via ssh it's a bit harder to diagnose, since all git knows\nis that the ssh-server closed its connection. For security reasons, it\ndoesn't necessarily tell you why it did that, so it's hard to know what\nthe real problem is.\n\n> I understand that to add my further changes, I should set up a local branch\n> to track this updated remote branch. But I'm assuming that the rebase must\n> be done while switched to the remote branch...?\n> \n\nNot really. You can do \"git rebase --onto origin/master master\". However,\nsince you merged origin/master earlier, a rebase will only tell you that\nyou're up-to-date.\n\n\"git help rebase\" might be worth looking into though.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"62669","messageId":"475E3415.3030208@op5.se","threadId":"11223","inReplyTo":"5F13DCA7-5072-4D76-89A7-7F05A5928FA2@gmail.com","subject":"Re: \"remote end hung up unexpectedly\"","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-12-11T06:54:13Z","receivedAt":"2007-12-11T06:54:13Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"I'm bringing this back on the list. It's very uncharitable of you to not\ndo so yourself, as it prevents others with the same problem to find the\nanswer in the archives. Also, I don't run a private support-center for\ngit, so emailing me privately with questions regarding it is just plain\nrude. Everyone's entitled to a second chance though, so read on below.\n\nClifford Heath wrote:\n> On 11/12/2007, at 12:11 AM, Andreas Ericsson wrote:\n>> How did you clone it? If you cloned via git:// protocol, you most likely\n>> can't push back there. The git-daemon supports pushing, but does no\n>> authentication.\n> \n> That was a problem - shame git didn't say \"connection refused\" instead,\n> that would have been more obvious. The manpages are loaded with\n> git-specific jargon - almost impenetrable for a newbie.\n> \n\nGit doesn't see that. It only knows it didn't get a proper response from\nthe other end.\n\n> \n>> Not really. You can do \"git rebase --onto origin/master master\". However,\n>> since you merged origin/master earlier, a rebase will only tell you that\n>> you're up-to-date.\n> \n> I don't think that anything I've done has affected the remote repository.\n\n\nIt hasn't. The only way you can update the remote repository, short of\nediting it manually, is to use \"git push\". That's not strictly true, but\nfor the sake of this argument, it will suffice.\n\n\n> At least, no changes are visible in the web view.\n> \n\nYou can merge between local branches and still get the \"up-to-date\" message.\n\n\n> Most of the instructions and manpages I've read show how to do things\n> to local repositories and push changes back. Here's what I most recently\n> tried, perhaps you can see where I went wrong. I've changed the project\n> name for PROJECT, and the branch name with BRANCH\n> \n> git clone git+ssh://cjheath@repo.or.cz/srv/git/PROJECT.git\n> cd PROJECT\n> git checkout --track -b BRANCH origin/BRANCH\n> git rebase origin/master\n> \n> At this point the local branch seems to have the content I want, so I tried\n> to push the changes back in:\n> \n\nYou mean, \"at this point BRANCH seems to have the content I want\"?\n\n> git push\n> \n> Which replied:\n> \n> error: remote 'refs/heads/BRANCH' is not a strict subset of local ref \n> 'refs/heads/BRANCH'. maybe you are not up-to-date and need to pull first?\n> error: failed to push to 'git+ssh://cjheath@repo.or.cz/srv/git/PROJECT.git'\n> \n\nYes. What you did caused history to be rewritten. Push is fast-forward[1]\nonly by default, to prevent published history from being modified, so when\nyou moved one line of development onto another you effectively changed its\nancestry.\n\nIf you do\n\ngit checkout BRANCH\ngit reset --hard origin/BRANCH\ngit merge origin/master\ngit push\n\nyou will achieve the desired end-result. If you really, really want a linear\nhistory, you can do\n\ngit push -f origin BRANCH\n\nbut beware that this will cause errors for everyone fetching from you, and\nfor yourself if you fetch into multiple local clones of the same remote.\n\nI suggest you sit down and really read through the git rebase man-page to\nunderstand what it does and the precautions one must take when rewriting\nhistory like that.\n\n\n[1]fast-forward:\n    A fast-forward is a special type of merge where you have a\n    revision and you are \"merging\" another branch's changes that\n    happen to be a descendant of what you have. In such cases,\n    you do not make a new merge commit but instead just update\n    to his revision. This will happen frequently on a tracking\n    of a remote repository.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"62677","messageId":"A24153E2-0C85-44FB-B03E-18663A854194@gmail.com","threadId":"11223","inReplyTo":"475E3415.3030208@op5.se","subject":"Re: \"remote end hung up unexpectedly\"","fromName":"Clifford Heath","fromEmail":"clifford.heath@gmail.com","sentAt":"2007-12-11T07:15:56Z","receivedAt":"2007-12-11T07:15:56Z","isPatch":false,"sender":{"key":"clifford.heath@gmail.com","avatar":null},"body":"On 11/12/2007, at 5:54 PM, Andreas Ericsson wrote:\n> I'm bringing this back on the list. It's very uncharitable of you  \n> to not\n> do so yourself,\n\nMy humble apologies - I just hit reply. I've previously only encountered\nmajordomo configurations where the reply goes to the list (including\nwhen I operated majordomo for ten years), so I made a mistake.\n\n>>> Not really. You can do \"git rebase --onto origin/master master\".  \n>>> However,\n>>> since you merged origin/master earlier, a rebase will only tell  \n>>> you that\n>>> you're up-to-date.\n>> I don't think that anything I've done has affected the remote  \n>> repository.\n>\n> It hasn't. The only way you can update the remote repository, short of\n> editing it manually, is to use \"git push\". That's not strictly  \n> true, but\n> for the sake of this argument, it will suffice.\n\nThanks, that's good confirmation.\n\n>> Most of the instructions and manpages I've read show how to do things\n>> to local repositories and push changes back. Here's what I most  \n>> recently\n>> tried, perhaps you can see where I went wrong. I've changed the  \n>> project\n>> name for PROJECT, and the branch name with BRANCH\n>> git clone git+ssh://cjheath@repo.or.cz/srv/git/PROJECT.git\n>> cd PROJECT\n>> git checkout --track -b BRANCH origin/BRANCH\n>> git rebase origin/master\n>> At this point the local branch seems to have the content I want,  \n>> so I tried\n>> to push the changes back in:\n>\n> You mean, \"at this point BRANCH seems to have the content I want\"?\n\nNo, I mean that the recent changes have been pulled from origin/master\nand my tree looks like what I want the remote origin/BRANCH to look  \nlike.\nThough if I pushed, I don't know that its revision history would  \nnecessarily\nbe in the preferred order.\n\n>> git push\n>> Which replied:\n>> error: remote 'refs/heads/BRANCH' is not a strict subset of local  \n>> ref 'refs/heads/BRANCH'. maybe you are not up-to-date and need to  \n>> pull first?\n>> error: failed to push to 'git+ssh://cjheath@repo.or.cz/srv/git/ \n>> PROJECT.git'\n>\n> Yes. What you did caused history to be rewritten. Push is fast- \n> forward[1]\n> only by default, to prevent published history from being modified,  \n> so when\n> you moved one line of development onto another you effectively  \n> changed its\n> ancestry.\n\nOk, I think I follow that. I can see I need to spend more time  \nreading the\nman pages.  Thanks for your help...\n\nClifford Heath.\n\n> If you do\n>\n> git checkout BRANCH\n> git reset --hard origin/BRANCH\n> git merge origin/master\n> git push\n>\n> you will achieve the desired end-result. If you really, really want  \n> a linear\n> history, you can do\n>\n> git push -f origin BRANCH\n>\n> but beware that this will cause errors for everyone fetching from  \n> you, and\n> for yourself if you fetch into multiple local clones of the same  \n> remote.\n>\n> I suggest you sit down and really read through the git rebase man- \n> page to\n> understand what it does and the precautions one must take when  \n> rewriting\n> history like that.\n>\n>\n> [1]fast-forward:\n>    A fast-forward is a special type of merge where you have a\n>    revision and you are \"merging\" another branch's changes that\n>    happen to be a descendant of what you have. In such cases,\n>    you do not make a new merge commit but instead just update\n>    to his revision. This will happen frequently on a tracking\n>    of a remote repository.\n>\n> -- \n> Andreas Ericsson                   andreas.ericsson@op5.se\n> OP5 AB                             www.op5.se\n> Tel: +46 8-230225                  Fax: +46 8-230231\n"}]}