{"thread":{"id":"22120","subject":"Strange happening with 'git fetch'","startedAt":"2010-01-07T17:59:39Z","lastAt":"2010-01-07T18:07:42Z","messageCount":2,"participants":["David Kirk","Ilari Liusvaara"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"131021","messageId":"de73f1891001070959h30e4ecebw7c852f0417647419@mail.gmail.com","threadId":"22120","inReplyTo":null,"subject":"Strange happening with 'git fetch'","fromName":"David Kirk","fromEmail":"davemkirk@gmail.com","sentAt":"2010-01-07T17:59:39Z","receivedAt":"2010-01-07T17:59:39Z","isPatch":false,"sender":{"key":"davemkirk@gmail.com","avatar":null},"body":"This is very strange, and defies the understanding of everyone in the\noffice familiar with git.  Is it a bug, or some feature we don't\nunderstand?\n\nBasically, when I do a 'git fetch', it updates my local repository.\nNow nobody else is doing anything, so the remote repository does not\nchange.  Doing another 'git fetch' should report that nothing needs to\nbe done and nothing should change.  But instead, it reports something\nabout the remote HEAD, and changes my local branch 'master' to some\nstrange location!  Running 'git fetch' again restores it to the\ncorrect state, reporting that it is updating 'master'.  Repeated\ninvocations will toggle between these two results.  Below is a\ntranscript from the bash shell.\n\nCan someone please explain this?\n\n---- bash console ----\ndkirk@RI-ENG-21 /c/Dev/TSWeb2 (master)\n$ git fetch\nFrom //10.18.0.53/git/repos/WebTrading\n + 03c60a4...209b0bc HEAD       -> origin/HEAD  (forced update)\n\ndkirk@RI-ENG-21 /c/Dev/TSWeb2 (master)\n$ git fetch\nFrom //10.18.0.53/git/repos/WebTrading\n + 209b0bc...03c60a4 master     -> origin/master  (forced update)\n\ndkirk@RI-ENG-21 /c/Dev/TSWeb2 (master)\n$ git fetch\nFrom //10.18.0.53/git/repos/WebTrading\n + 03c60a4...209b0bc HEAD       -> origin/HEAD  (forced update)\n\ndkirk@RI-ENG-21 /c/Dev/TSWeb2 (master)\n$ git fetch\nFrom //10.18.0.53/git/repos/WebTrading\n + 209b0bc...03c60a4 master     -> origin/master  (forced update)\n\nThanks,\n-David\n"},{"id":"131025","messageId":"20100107180742.GA27643@Knoppix","threadId":"22120","inReplyTo":"de73f1891001070959h30e4ecebw7c852f0417647419@mail.gmail.com","subject":"Re: Strange happening with 'git fetch'","fromName":"Ilari Liusvaara","fromEmail":"ilari.liusvaara@elisanet.fi","sentAt":"2010-01-07T18:07:42Z","receivedAt":"2010-01-07T18:07:42Z","isPatch":false,"sender":{"key":"ilari.liusvaara@elisanet.fi","avatar":null},"body":"On Thu, Jan 07, 2010 at 11:59:39AM -0600, David Kirk wrote:\n> This is very strange, and defies the understanding of everyone in the\n> office familiar with git.  Is it a bug, or some feature we don't\n> understand?\n> \n> Basically, when I do a 'git fetch', it updates my local repository.\n> Now nobody else is doing anything, so the remote repository does not\n> change.  Doing another 'git fetch' should report that nothing needs to\n> be done and nothing should change.  But instead, it reports something\n> about the remote HEAD, and changes my local branch 'master' to some\n> strange location!  Running 'git fetch' again restores it to the\n> correct state, reporting that it is updating 'master'.  Repeated\n> invocations will toggle between these two results.  Below is a\n> transcript from the bash shell.\n> \n> Can someone please explain this?\n\nI have seen that before. Looks like you have local branch 'HEAD' (_not_\nthe special ref HEAD) on remote side and that is messing it up.\n\nls-remote'ing the repository shows 'refs/heads/HEAD', right (there's\nalso HEAD, that's the required special ref)?\n\n-Ilari\n"}]}