[Q] `git push', branch management, and "(forced update)"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

   A colleague of mine will be asking for my help when he
  returns later this week, and I'm not too certain what's
  going on.  My instant reaction is what he's doing may not
  be a good idea (an example of rebasing a branch that others
  pull, which I understand should be avoided).  However, I'm
  not a gitpert, and am also sufficiently confused it's worth
  asking for help/advice.  My apologies for the length....

   What we have is four (4) repositories, L, B, R, and M:

     L is my colleague's (local) working repository.
     B is a bare repository.
     R is one (or more?) remote repositories.
     M is a bare repository.

  The model is work is done in R, patches are sent (by e-mail)
  to my colleague, who applies them to L, often does some fixes
  (in L), pushes the resultant applied-patch-plus-fixes to B;
  and R pulls every now and then from B.  The cycle repeats.
  (M, as such, does not enter the picture at this point.)

   More specifically, what my colleague does (I think, I may
  not have this completely correct) is apply the patches to
  a topic branch TOPIC.  His fixes are separate commits, also
  on TOPIC, so (in theory) TOPIC grows in a nice linear manner
  (`r' came from R via e-mail, `f' is a local fix):

     o--o--o--o master
               \
                r--r--f--f TOPIC

   L is a clone of M, where other work has also been committed,
   in master.  So now-and-then my colleague pulls M into L:

     o--o--o--o--*--* master
               \
                r--r--f--f TOPIC

  My colleague then pushes the result to B.  End result is B
  is essentially M plus TOPIC.

   As it happens (mostly by design), the changes on TOPIC
  are independent of the `*' ones on master.  So, working
  in L, my colleague often rebases, and this is (always?)
  a fast-forward:

     o--o--o--o--*--* master
                     \
                      r--r--f--f TOPIC

  He now wants to push that structure to B, so that R can
  later pull the updated world.  Based on some experiments,
  he does (in L):

     $ git checkout master
     $ git push --tags ssh://.../B.git  +:

  (I'm not sure why he is using `--tags', or `+:' instead
  of a simple `:') but reports what happens is the `push'
  gets the error(?):

     fatal: remote part of refspec is not a valid name in +:

   Given that `git help push' (1.6.2.2) lists/describes the
  `+:' <refspec>, I'm (extra) baffled.  What's going on?

   Each of the repositories L, B, R, and M are on different
  machines, and it is highly probable different versions of
  git are being used.

   In a simple simulation test I tried, it not only worked
  for me, but the subsequent pull from simulated-B into
  simulated-R said the TOPIC was a "(forced update)".
  What does that mean?

   And what is it my colleague should consider doing (or,
  reading?)?

  Again, apologies for the length!

cheers,
	-blf-

-- 
“How many surrealists does it take to   | Brian Foster
 change a lightbulb? Three. One calms   | somewhere in south of France
 the warthog, and two fill the bathtub  |   Stop E$$o (ExxonMobil)!
 with brightly-coloured machine tools.” |      http://www.stopesso.com
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]