{"thread":{"id":"24717","subject":"[Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","startedAt":"2010-08-12T07:54:27Z","lastAt":"2010-08-13T07:22:23Z","messageCount":11,"participants":["Brian Foster","Tomas Carnecky","Brandon Casey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"147881","messageId":"201008120954.27648.brian.foster@innova-card.com","threadId":"24717","inReplyTo":null,"subject":"[Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Brian Foster","fromEmail":"brian.foster@innova-card.com","sentAt":"2010-08-12T07:54:27Z","receivedAt":"2010-08-12T07:54:27Z","isPatch":false,"sender":{"key":"brian.foster@innova-card.com","avatar":null},"body":"\n Bare repository ORIG's master looks like this:\n\n   o--o--o--o--v1--o--v2--o--o--o HEAD\n\n where v1 and v2 are (annotated) tagged commits.\n\n Repository SLAVE is a mirror clone of ORIG which\n (very deliberately!) lags behind (i.e., its HEAD\n is one of the earlier (and usually tagged) commits\n on ORIG).  SLAVE's master was like this:\n\n   o--o--o--o--v1 HEAD\n\n We wanted to update its HEAD to v2, so did:\n\n   git fetch ORIG tag v2\n\n This gave us:\n\n   o--o--o--o--v1 HEAD\n                 \\ \n                  o--v2\n\n It did not update SLAVE's HEAD to v2, which we wanted.\n This was worked-around by editing refs/heads/master(?)\n but we don't want to do that again (esp. since we got\n it wrong the first time (Thank you back-ups!)).\n\n Whilst we want to switch to a push from ORIG to SLAVE\n model, until that happens (there are some IT issues),\n we are still fetching on SLAVE from ORIG.  Hence, how\n can we avoid the above issue; that is, what should we\n have done?  Searching various docs has failed to find\n any clew or answer.\n\n There are several GIT versions involved (all(?) are\n 1.5-ish or later).  Below is a script to reproduce\n the situation (tested with v1.7.0.2).\n\ncheers!\n\t-blf-\n\n=====(cut here and below)===== demo.sh =====(git version 1.7.0.2)=====\n#!/bin/bash\n\nadd_new_files() {\n\ttouch   -- \"$@\"\n\tgit add -- \"$@\"\n\tgit commit -m \"Added: $*\"\n}\n\nset -xe\n\nmkdir ORIG\ncd ORIG\ngit init\t# ORIG is bare in real case\n\nadd_new_files foo\nadd_new_files bar\n\ngit tag -a -m First v1\n\ncd ..\ngit clone --bare --mirror ORIG SLAVE.git\n\ncd ORIG\n\nadd_new_files xyzzy\nadd_new_files plover\n\ngit tag -a -m Update v2\n\nadd_new_files stuff\nadd_new_files more_stuff\n\ncd ../SLAVE.git\n\ngit fetch --verbose origin tag v2\n\n# SLAVE's master's HEAD has not changed ....  ;-(\n\ngit tag -l\ngit log --oneline master\ngit log --oneline v2\n=====(cut here and above)===== demo.sh =====(git version 1.7.0.2)=====\n"},{"id":"147884","messageId":"4C63B1C9.6050801@dbservice.com","threadId":"24717","inReplyTo":"201008120954.27648.brian.foster@innova-card.com","subject":"Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2010-08-12T08:33:13Z","receivedAt":"2010-08-12T08:33:13Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"On 8/12/10 9:54 AM, Brian Foster wrote:\n> \n>  Bare repository ORIG's master looks like this:\n> \n>    o--o--o--o--v1--o--v2--o--o--o HEAD\n> \n>  where v1 and v2 are (annotated) tagged commits.\n> \n>  Repository SLAVE is a mirror clone of ORIG which\n>  (very deliberately!) lags behind (i.e., its HEAD\n>  is one of the earlier (and usually tagged) commits\n>  on ORIG).  SLAVE's master was like this:\n> \n>    o--o--o--o--v1 HEAD\n> \n>  We wanted to update its HEAD to v2, so did:\n> \n>    git fetch ORIG tag v2\n> \n>  This gave us:\n> \n>    o--o--o--o--v1 HEAD\n>                  \\ \n>                   o--v2\n> \n>  It did not update SLAVE's HEAD to v2, which we wanted.\n>  This was worked-around by editing refs/heads/master(?)\n>  but we don't want to do that again (esp. since we got\n>  it wrong the first time (Thank you back-ups!)).\n\nFetch only fetches commits. It doesn't update any local refs (other than\nFETCH_HEAD). If you want to switch HEAD to that new tag, use checkout.\n\n>  Whilst we want to switch to a push from ORIG to SLAVE\n>  model, until that happens (there are some IT issues),\n>  we are still fetching on SLAVE from ORIG.  Hence, how\n>  can we avoid the above issue; that is, what should we\n>  have done?  Searching various docs has failed to find\n>  any clew or answer.\n\nIs SLAVE a bare repo? If not, please see\nhttps://git.wiki.kernel.org/index.php/GitFaq#non-bare.\n\ntom\n"},{"id":"147893","messageId":"201008121238.51983.brian.foster@innova-card.com","threadId":"24717","inReplyTo":"4C63B1C9.6050801@dbservice.com","subject":"Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Brian Foster","fromEmail":"brian.foster@innova-card.com","sentAt":"2010-08-12T10:38:51Z","receivedAt":"2010-08-12T10:38:51Z","isPatch":false,"sender":{"key":"brian.foster@innova-card.com","avatar":null},"body":"On Thursday 12 August 2010 10:33:13 Tomas Carnecky wrote:\n\nTom,\n Thanks for the reply, but I suspect you didn't read\n the problem correctly ....\n\n> On 8/12/10 9:54 AM, Brian Foster wrote:\n> >  Bare repository ORIG's master looks like this:\n> >[ ... ] \n> >  Repository SLAVE is a mirror clone of ORIG which\nNOTE.......................^^^^^^\n>[ ... ] \n> Fetch only fetches commits. It doesn't update any local refs (other than\n> FETCH_HEAD). If you want to switch HEAD to that new tag, use checkout.\n\n No, a fetch in a mirror, when fetching all the way\n to the HEAD (e.g., a simple `git fetch origin'),\n does update the branch.  (You can easily modify the\n script I included to prove this.)\n\n>[ ... ]\n> Is SLAVE a bare repo?  [ ... ]\n\n Yes it is bare (because it's a mirror), as per the\n description, subject, and posted script.\ncheers!\n\t-blf-\n"},{"id":"147894","messageId":"4C63D579.507@dbservice.com","threadId":"24717","inReplyTo":"201008121238.51983.brian.foster@innova-card.com","subject":"Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2010-08-12T11:05:29Z","receivedAt":"2010-08-12T11:05:29Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"On 8/12/10 12:38 PM, Brian Foster wrote:\n> On Thursday 12 August 2010 10:33:13 Tomas Carnecky wrote:\n> \n> Tom,\n>  Thanks for the reply, but I suspect you didn't read\n>  the problem correctly ....\n\nI suspect I did but did not explain correctly (though I didn't realize\nmirror implies bare, my bad).\n\n> \n>> On 8/12/10 9:54 AM, Brian Foster wrote:\n>>>  Bare repository ORIG's master looks like this:\n>>> [ ... ] \n>>>  Repository SLAVE is a mirror clone of ORIG which\n> NOTE.......................^^^^^^\n>> [ ... ] \n>> Fetch only fetches commits. It doesn't update any local refs (other than\n>> FETCH_HEAD). If you want to switch HEAD to that new tag, use checkout.\n\nOh boy, that explanation is really bad -.- What I meant is that if you\ndon't supply the <dst> part of the refspec it will only update\nFETCH_HEAD. So 'git fetch origin master' will not update anything but\nFETCH_HEAD.\n\n>  No, a fetch in a mirror, when fetching all the way\n>  to the HEAD (e.g., a simple `git fetch origin'),\n>  does update the branch.  (You can easily modify the\n>  script I included to prove this.)\n\nThere are different ways to invoke git fetch. Either way, fetch will\nnever modify HEAD. However, it can modify the branch that HEAD is\npointing to (in case HEAD is a symref). But you are not fetching a\nbranch, you are fetching a tag. So you need to use checkout after you\nfetch it. Either 'git checkout FETCH_HEAD' or 'git checkout v2'.\n\ntom\n"},{"id":"147896","messageId":"201008121416.35887.brian.foster@innova-card.com","threadId":"24717","inReplyTo":"4C63D579.507@dbservice.com","subject":"[SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Brian Foster","fromEmail":"brian.foster@innova-card.com","sentAt":"2010-08-12T12:16:35Z","receivedAt":"2010-08-12T12:16:35Z","isPatch":false,"sender":{"key":"brian.foster@innova-card.com","avatar":null},"body":"On Thursday 12 August 2010 13:05:29 Tomas Carnecky wrote:\n> On 8/12/10 12:38 PM, Brian Foster wrote:\n> > On Thursday 12 August 2010 10:33:13 Tomas Carnecky wrote:\n> >[ ... ]\n> >> Fetch only fetches commits. It doesn't update any local refs (other than\n> >> FETCH_HEAD). If you want to switch HEAD to that new tag, use checkout.\n> \n> Oh boy, that explanation is really bad -.- What I meant is that if\n> you don't supply the <dst> part of the refspec it will only update\n> FETCH_HEAD. So 'git fetch origin master' will not update anything\n> but FETCH_HEAD.\n\n I concur.  However, the “refspec” in this case is the obscure\n ‘tag TAGNAME’ (where the ‘tag’ is a keyword); see get-fetch(1)\n at the end of §OPTIONS where it describes “short-cut notations”.\n That does not seem to accept a :<dst>, nor would I be too sure\n what it meant if it did.\n\n> >  No, a fetch in a mirror, when fetching all the way\n> >  to the HEAD (e.g., a simple `git fetch origin'),\n> >  does update the branch.  [ ... ]\n> \n> There are different ways to invoke git fetch. Either way, fetch will\n> never modify HEAD. However, it can modify the branch that HEAD is\n> pointing to (in case HEAD is a symref). \n\n Point taken, I was being sloppy.  We want the head of the\n relevant branch (master) to be updated in our bare (mirror)\n repository.\n\n>                                         But you are not fetching a\n> branch, you are fetching a tag. So you need to use checkout after you\n> fetch it. Either 'git checkout FETCH_HEAD' or 'git checkout v2'.\n\n NO.  ‘get checkout ...’ does not work in a bare repository.\n (You can modify my trivial posted script to prove this.)\n\n However, your comment got me to thinking.  This _does_ work:\n\n    git reset --soft FETCH_HEAD\n\n (And, I presume without testing, so would ‘... v2’ ?)\n Given that git-reset(1)'s purpose is to change the branch's\n head (or to change HEAD as I've been incorrectly describing\n it), that does make sense.\n\ncheers!\n\t-blf-\n"},{"id":"147898","messageId":"4C63E9E9.7070105@dbservice.com","threadId":"24717","inReplyTo":"201008121416.35887.brian.foster@innova-card.com","subject":"Re: [SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2010-08-12T12:32:41Z","receivedAt":"2010-08-12T12:32:41Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"On 8/12/10 2:16 PM, Brian Foster wrote:\n>  NO.  ‘get checkout ...’ does not work in a bare repository.\n>  (You can modify my trivial posted script to prove this.)\n> \n>  However, your comment got me to thinking.  This _does_ work:\n> \n>     git reset --soft FETCH_HEAD\n> \n>  (And, I presume without testing, so would ‘... v2’ ?)\n>  Given that git-reset(1)'s purpose is to change the branch's\n>  head (or to change HEAD as I've been incorrectly describing\n>  it), that does make sense.\n\nI expected git checkout to work even in a bare repo - as you can see I\ndon't work that often inside bare repos :).\n\nYou should use update-ref instead of reset. The problem with reset is\nthat it changes the branch and not HEAD. Say initially your mirror had\nHEAD as symref pointing to refs/heads/master. When you run reset --soft\nv2 your master branch will now point to the same commit as the tag v2\n(and HEAD will be still pointing to refs/heads/master). When you use\n'git update-ref --no-deref HEAD v2' it will modify HEAD directly and\nhave it point directly to the same commit as v2 (also called detached HEAD).\n\ntom\n"},{"id":"147902","messageId":"201008121522.55020.brian.foster@innova-card.com","threadId":"24717","inReplyTo":"4C63E9E9.7070105@dbservice.com","subject":"Re: [SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Brian Foster","fromEmail":"brian.foster@innova-card.com","sentAt":"2010-08-12T13:22:54Z","receivedAt":"2010-08-12T13:22:54Z","isPatch":false,"sender":{"key":"brian.foster@innova-card.com","avatar":null},"body":"On Thursday 12 August 2010 14:32:41 Tomas Carnecky wrote:\n> On 8/12/10 2:16 PM, Brian Foster wrote:\n> >[ ... ]  This _does_ work:\n> > \n> >     git reset --soft FETCH_HEAD\n> >[ ... ] \n> >  Given that git-reset(1)'s purpose is to change the branch's\n> >  head (or to change HEAD as I've been incorrectly describing\n> >  it), that does make sense.\n> \n> I expected git checkout to work even in a bare repo - as you can\n> see I don't work that often inside bare repos :).\n\n <<<giggles>>>  No problem!  (I don't either, this situation was\n unexpected, but as SLAVE lagging behind ORIG is anticipated as\n being the usual case, we need to understand it.)\n\n> You should use update-ref instead of reset. The problem with reset is\n> that it changes the branch and not HEAD. Say initially your mirror had\n> HEAD as symref pointing to refs/heads/master.\n\n Correct, it does.\n\n>                                               When you run reset --soft\n> v2 your master branch will now point to the same commit as the tag v2\n> (and HEAD will be still pointing to refs/heads/master).\n\n Correct, that is what happens.  It also looks Ok to me,\n nor have any tests hit any snags.  It also happens to\n match how we (eventually) manually repaired SLAVE.\n\n>                                                         When you use\n> 'git update-ref --no-deref HEAD v2' it will modify HEAD\n\n NO, it gets an error (following is from a modified version\n of my previously-posted script):\n────────────────────────────────────────────────────────\n ...\n+ cd ../SLAVE.git                                           \n+ git fetch --verbose origin tag v2                         \n ...\nFrom /work/tmp/git/ORIG                      \n * [new tag]         v2         -> v2        \n+ git update-ref --no-deref HEAD v2          \nerror: Trying to write non-commit object 2bc324e6a68cb3704448c9f63ddc3bc0260c0b48 to branch HEAD                                                                                \nfatal: Cannot update the ref 'HEAD'.                                                    \n$ \n────────────────────────────────────────────────────────\n\n Using ‘git update-ref --no-deref HEAD FETCH_HEAD’ does\n not error, and, as you say (below), does seem to give\n me a detached head.\n\n> 'git update-ref --no-deref HEAD v2' it will modify HEAD directly and\n> have it point directly to the same commit as v2 (also called detached HEAD).\n\n I do_not_ want a detached head!  This has perhaps been\n confused by my improperly saying “update HEAD” when I\n meant “update the master branch”.  If you look back at\n my originally-posted diagrams, it's a reasonable guess\n I don't want a detached head.  Having HEAD continue to\n be a symref to refs/heads/master (which, in this case,\n is the same commit as v2) is correct.\n\n Thanks for your help, advice, and hints.\ncheers!\n\t-blf-\n"},{"id":"147903","messageId":"4C63F860.2090600@dbservice.com","threadId":"24717","inReplyTo":"201008121522.55020.brian.foster@innova-card.com","subject":"Re: [SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2010-08-12T13:34:24Z","receivedAt":"2010-08-12T13:34:24Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"On 8/12/10 3:22 PM, Brian Foster wrote:\n> On Thursday 12 August 2010 14:32:41 Tomas Carnecky wrote:\n>>                                                         When you use\n>> 'git update-ref --no-deref HEAD v2' it will modify HEAD\n> \n>  NO, it gets an error (following is from a modified version\n>  of my previously-posted script):\n> + git update-ref --no-deref HEAD v2          \n> error: Trying to write non-commit object 2bc324e6a68cb3704448c9f63ddc3bc0260c0b48 to branch HEAD                                                                                \n\nOh the subtleties when working with plumbing:\ngit update-ref --no-deref HEAD v2^{commit}\n\n>  Using ‘git update-ref --no-deref HEAD FETCH_HEAD’ does\n>  not error, and, as you say (below), does seem to give\n>  me a detached head.\n> \n>> 'git update-ref --no-deref HEAD v2' it will modify HEAD directly and\n>> have it point directly to the same commit as v2 (also called detached HEAD).\n> \n>  I do_not_ want a detached head!  This has perhaps been\n>  confused by my improperly saying “update HEAD” when I\n>  meant “update the master branch”.  If you look back at\n>  my originally-posted diagrams, it's a reasonable guess\n>  I don't want a detached head.  Having HEAD continue to\n>  be a symref to refs/heads/master (which, in this case,\n>  is the same commit as v2) is correct.\n\nJust make sure your tools and scripts don't break when you reset the\nbranch like that (especially when the update is non-fast forward as\nfetch+reset won't warn you when this happens).\n\ntom\n"},{"id":"147917","messageId":"Xp6r8yG_6tK_gooNBRqAKdsGRTcXgRo-b1bJv3J7ckxs2iD_-UXlPw@cipher.nrlssc.navy.mil","threadId":"24717","inReplyTo":"201008120954.27648.brian.foster@innova-card.com","subject":"Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-08-12T17:02:49Z","receivedAt":"2010-08-12T17:02:49Z","isPatch":false,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"Brian Foster wrote:\n>  Bare repository ORIG's master looks like this:\n> \n>    o--o--o--o--v1--o--v2--o--o--o HEAD\n> \n>  where v1 and v2 are (annotated) tagged commits.\n> \n>  Repository SLAVE is a mirror clone of ORIG which\n>  (very deliberately!) lags behind (i.e., its HEAD\n>  is one of the earlier (and usually tagged) commits\n>  on ORIG).  SLAVE's master was like this:\n> \n>    o--o--o--o--v1 HEAD\n> \n>  We wanted to update its HEAD to v2, so did:\n> \n>    git fetch ORIG tag v2\n> \n>  This gave us:\n> \n>    o--o--o--o--v1 HEAD\n>                  \\ \n>                   o--v2\n> \n>  It did not update SLAVE's HEAD to v2, which we wanted.\n\nAre you using --mirror only so that the branch pointer in\nthe mirror repository will be updated when you fetch?\n\nIf you are not really interested in having a \"real\" mirror,\nthen maybe you should set your mirror up to track a\nspecific branch (or branches) in the mirrored repository.\n\nYou could have a branch named for example \"for_mirror/master\",\nin the mirrored repository (ORIG) that you would prepare.\nYou could update the for_mirror/master branch when you were\nready using 'git branch' like this:\n\n   git branch -f for_mirror/master v2\n\nIn the mirror repository (SLAVE), you would update the\nfetchspec so that the mirror mirrored the branches below\nthe \"for_mirror\" namespace in the remote repository\nlike this:\n\n   fetch = +refs/heads/for_mirror/*:refs/heads/*\n\nThen, a simple 'git fetch' would fetch the updates (including\ntags) and update the branch pointer in the mirror like you want\nit to do.  Tracking multiple branches this way is possible just\nby creating another branch in the ORIG repository with the proper\nname.\n\n-Brandon\n"},{"id":"147991","messageId":"201008130903.56375.brian.foster@innova-card.com","threadId":"24717","inReplyTo":"4C63F860.2090600@dbservice.com","subject":"Re: [SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Brian Foster","fromEmail":"brian.foster@innova-card.com","sentAt":"2010-08-13T07:03:56Z","receivedAt":"2010-08-13T07:03:56Z","isPatch":false,"sender":{"key":"brian.foster@innova-card.com","avatar":null},"body":"On Thursday 12 August 2010 15:34:24 Tomas Carnecky wrote:\n> On 8/12/10 3:22 PM, Brian Foster wrote:\n> > On Thursday 12 August 2010 14:32:41 Tomas Carnecky wrote:\n> >>                                                         When you use\n> >> 'git update-ref --no-deref HEAD v2' it will modify HEAD\n> > \n> >  NO, it gets an error [ ... ]\n> \n> Oh the subtleties when working with plumbing:\n>    git update-ref --no-deref HEAD v2^{commit}\n\n Yes, that updates HEAD, leaving SLAVE in the odd state\n of HEAD being v2 and master's head being v1 (which I\n presume is another example of detached head?).\n\n> >[ ... ]\n> >  I do_not_ want a detached head!  This has perhaps been\n> >  confused by my improperly saying “update HEAD” when I\n> >  meant “update the master branch”.  [ ... ]\n> >                                 Having HEAD continue to\n> >  be a symref to refs/heads/master (which, in this case,\n> >  is the same commit as v2) is correct.\n> \n> Just make sure your tools and scripts don't break when you reset the\n> branch like that (especially when the update is non-fast forward as\n> fetch+reset won't warn you when this happens).\n\n Understood.  And I'm not too worried about that happening,\n albeit the current procedures are perhaps not as robust as\n they could or should be.  Again, thanks for the suggestions\n and help.\n\ncheers!\n\t-blf-\n"},{"id":"147992","messageId":"201008130922.23717.brian.foster@innova-card.com","threadId":"24717","inReplyTo":"Xp6r8yG_6tK_gooNBRqAKdsGRTcXgRo-b1bJv3J7ckxs2iD_-UXlPw@cipher.nrlssc.navy.mil","subject":"Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?","fromName":"Brian Foster","fromEmail":"brian.foster@innova-card.com","sentAt":"2010-08-13T07:22:23Z","receivedAt":"2010-08-13T07:22:23Z","isPatch":false,"sender":{"key":"brian.foster@innova-card.com","avatar":null},"body":"On Thursday 12 August 2010 19:02:49 Brandon Casey wrote:\n> Brian Foster wrote:\n> >  Bare repository ORIG's master looks like this [ I've updated\n> >  all of the diagrams slightly to remove some confusion  -blf]:\n> > \n> >    o--o--o--o--v1--o--v2--o--o--o [master &] HEAD\n> > \n> >  where v1 and v2 are (annotated) tagged commits.\n> > \n> >  Repository SLAVE is a mirror clone of ORIG which\n> >  (very deliberately!) lags behind (i.e., [SLAVE's master's head]\n> >  is one of the earlier (and usually tagged) commits\n> >  on ORIG).  SLAVE's master was like this:\n> > \n> >    o--o--o--o--v1 [master &] HEAD\n> > \n> >  We wanted to update [SLAVE's master's head] to v2, so did:\n> > \n> >    git fetch ORIG tag v2\n> > \n> >  This gave us:\n> > \n> >    o--o--o--o--v1 [master &] HEAD\n> >                  \\ \n> >                   o--v2\n> > \n> >  It did not update SLAVE's [master's head] to v2, which we wanted[:]\n\n       o--o--o--o--v1--o--v2 [master &] HEAD\n\n> Are you using --mirror only so that the branch pointer in\n> the mirror repository will be updated when you fetch?\n\n Correct.\n\n> If you are not really interested in having a \"real\" mirror,\n> then maybe you should set your mirror up to track a\n> specific branch (or branches) in the mirrored repository.\n\n Now that seems like an excellent idea!\n\n The embarrassing thing is, we actually do _do_ something\n similar elsewhere in the process.  So we haven't got any\n great excuse for not thinking of it ....  ;-\\ \n\n> You could have a branch named for example \"for_mirror/master\",\n> in the mirrored repository (ORIG) that you would prepare.\n> You could update the for_mirror/master branch when you were\n> ready using 'git branch' like this:\n> \n>    git branch -f for_mirror/master v2\n> \n> In the mirror repository (SLAVE), you would update the\n> fetchspec so that the mirror mirrored the branches below\n> the \"for_mirror\" namespace in the remote repository\n> like this:\n> \n>    fetch = +refs/heads/for_mirror/*:refs/heads/*\n> \n> Then, a simple 'git fetch' would fetch the updates (including\n> tags) and update the branch pointer in the mirror like you want\n> it to do.  Tracking multiple branches this way is possible just\n> by creating another branch in the ORIG repository with the proper\n> name.\n\n Another nice point about the above is it could deal\n with another procedural issue we have, which is the\n lack of a “staging area” for final test (a “pre-SLAVE”).\n Whilst we haven't (yet) had any (known) screw-ups in\n the final released system (what “mirror” SLAVE contains),\n it can happen.  The known screw-ups were all detected\n before it went to SLAVE, but by accident (IM(H?)O).\n\n Thanks for the idea/observation.\n\ncheers!\n\t-blf-\n"}]}