git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question on multi-level git repository heiarchy.
@ 2006-10-27  5:12 Ben Greear
  2006-10-27  5:25 ` Shawn Pearce
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Greear @ 2006-10-27  5:12 UTC (permalink / raw)
  To: git

Some time back, I cloned from the official kernel site.  I have created 
several
branches and patches and such, recently branching off of 2.6.18

I want to create an intermediate level..something like:

kernel.org git tree
       |
my git master tree
 /                          \
work-station-1   work-station-2  ....


Each of the work-station repositories should push/pull from my git 
master tree, and occasionally
the git master tree will also pull from the kernel.org git tree.

To attempt this, I uploaded the .git tree from my local work 
station..the tree I cloned a while
back, to the public server.

I was then able to clone the public server git tree on my local 
work-station in a clean directory.

So far so good...

Both pub server and work station had the current branch set to 
lf_v2.6.18, and gitk showed
the head and latest patch as what I would expect.  I then did a git 
checkout -f master on the
pub server and did a pull from the upstream kernel.
This seemed to work fine.

Then, on the work-station, I did a git checkout -f master, and also did 
a pull.
In this case, it seems that it is trying to merge with changes in the 
lf_v2.6.18 branch
instead of the the main 'master' tree (see below).

So, am I going about this all wrong, or did I just run into a glitch of 
some sort?  I should
mention that the work-station below is running git 1.3, where the master 
is running git 1.4.2.4 (latest in FC4).

[greear@xeon-dt linux-2.6.dev]$ git checkout -f master
[greear@xeon-dt linux-2.6.dev]$ git pull
greearb@ns2.lanforge.com's password:
Generating pack...
Done counting 1553 objects.
Result has 1056 objects.
Deltifying 1056 objects.
 100% (1056/1056) done
Unpacking 1056 objects
Total 1056, written 1056 (delta 894), reused 0 (delta 0)
 100% (1056/1056) done
* refs/heads/master: fast forward to branch 'master' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
  from 04fed361dadb7921507a470947ac23d2f26352cf to 
e80391500078b524083ba51c3df01bbaaecc94bb
* refs/heads/lf_v2.6.17.x: same as branch 'lf_v2.6.17.x' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/lk_v2.6.16.x.sts: same as branch 'lk_v2.6.16.x.sts' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/lf_v2.6.17: same as branch 'lf_v2.6.17' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/lf_v2.6.16.x: same as branch 'lf_v2.6.16.x' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/lk_v2.6.15.x.sts: same as branch 'lk_v2.6.15.x.sts' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/lk_v2.6.17.x: same as branch 'lk_v2.6.17.x' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/lf_v2.6.16: same as branch 'lf_v2.6.16' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/origin: same as branch 'lf_v2.6.18' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
* refs/heads/lk_v2.6.16.x: same as branch 'lk_v2.6.16.x' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
greearb@ns2.lanforge.com's password:
Auto-following refs/tags/v2.6.19-rc3
greearb@ns2.lanforge.com's password:
Generating pack...
Done counting 1 objects.
Deltifying 1 objects.
 100% (1/1) done
Total 1, written 1 (delta 0), reused 0 (delta 0)
Unpacking 1 objects
 100% (1/1) done
* refs/tags/v2.6.19-rc3: storing tag 'v2.6.19-rc3' of 
greearb@ns2.lanforge.com:/pub/linux-2.6
Warning: fetch updated the current branch head.
Warning: fast forwarding your working tree from
Warning: 04fed361dadb7921507a470947ac23d2f26352cf commit.
Trying really trivial in-index merge...
fatal: Merge requires file-level merging
Nope.
Merging HEAD with ea50583c9fba2e289d434bda9798a7b77ee8e3b4
Merging:
e80391500078b524083ba51c3df01bbaaecc94bb Merge 
master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
ea50583c9fba2e289d434bda9798a7b77ee8e3b4 Initial work of merging pktgen 
changes into 2.6.18.
found 1 common ancestor(s):
e478bec0ba0a83a48a0f6982934b6de079e7e6b3 Linux v2.6.18. Arrr!
Auto-merging net/core/skbuff.c
Auto-merging include/net/sock.h
Auto-merging net/core/pktgen.c
CONFLICT (content): Merge conflict in net/core/pktgen.c
Auto-merging net/decnet/dn_table.c
CONFLICT (content): Merge conflict in net/decnet/dn_table.c
Auto-merging net/ipv4/fib_frontend.c
CONFLICT (content): Merge conflict in net/ipv4/fib_frontend.c
Auto-merging arch/i386/kernel/tsc.c
Auto-merging net/ipv4/fib_rules.c
CONFLICT (content): Merge conflict in net/ipv4/fib_rules.c
Auto-merging net/core/dev.c
Auto-merging drivers/net/e1000/e1000_main.c
CONFLICT (content): Merge conflict in drivers/net/e1000/e1000_main.c
Auto-merging net/ipv4/arp.c
CONFLICT (content): Merge conflict in net/ipv4/arp.c
Auto-merging net/decnet/dn_fib.c
CONFLICT (content): Merge conflict in net/decnet/dn_fib.c
Auto-merging net/socket.c
Auto-merging include/linux/if.h
Auto-merging include/linux/compat_ioctl.h
Auto-merging include/linux/skbuff.h
Auto-merging include/linux/rtnetlink.h
CONFLICT (content): Merge conflict in include/linux/rtnetlink.h
Auto-merging fs/cifs/cifsglob.h
Auto-merging include/linux/if_vlan.h
Auto-merging net/ipv4/route.c
CONFLICT (content): Merge conflict in net/ipv4/route.c
Auto-merging net/core/ethtool.c
CONFLICT (content): Merge conflict in net/core/ethtool.c
Auto-merging net/packet/af_packet.c
Auto-merging include/linux/nfs_fs_sb.h
CONFLICT (content): Merge conflict in include/linux/nfs_fs_sb.h
Auto-merging net/8021q/vlan_dev.c
Auto-merging net/ipv6/route.c
CONFLICT (content): Merge conflict in net/ipv6/route.c
Auto-merging net/ipv4/fib_trie.c
Auto-merging include/linux/sunrpc/xprt.h
Auto-merging include/net/neighbour.h
Auto-merging include/net/ip_fib.h
CONFLICT (content): Merge conflict in include/net/ip_fib.h
Auto-merging drivers/net/e100.c
Auto-merging drivers/net/e1000/e1000.h
CONFLICT (content): Merge conflict in drivers/net/e1000/e1000.h
Auto-merging net/ipv4/fib_semantics.c
CONFLICT (content): Merge conflict in net/ipv4/fib_semantics.c
Auto-merging drivers/pci/quirks.c
Auto-merging net/ipv4/fib_lookup.h
CONFLICT (content): Merge conflict in net/ipv4/fib_lookup.h
Auto-merging net/ipv4/fib_hash.c
Auto-merging net/core/sock.c
Auto-merging net/Makefile
CONFLICT (content): Merge conflict in net/Makefile
Auto-merging net/decnet/dn_rules.c
CONFLICT (content): Merge conflict in net/decnet/dn_rules.c
Auto-merging include/linux/netdevice.h
Auto-merging net/decnet/dn_route.c
Auto-merging net/sunrpc/xprtsock.c
Auto-merging net/Kconfig
Auto-merging drivers/net/e1000/e1000_ethtool.c
CONFLICT (content): Merge conflict in drivers/net/e1000/e1000_ethtool.c
Auto-merging include/net/dn_fib.h
CONFLICT (content): Merge conflict in include/net/dn_fib.h
Auto-merging fs/nfs/super.c
CONFLICT (content): Merge conflict in fs/nfs/super.c
Auto-merging fs/cifs/connect.c
CONFLICT (content): Merge conflict in fs/cifs/connect.c

Automatic merge failed; fix conflicts and then commit the result.
[greear@xeon-dt linux-2.6.dev]$ git branch
  lf_v2.6.16
  lf_v2.6.16.x
  lf_v2.6.17
  lf_v2.6.17.x
  lf_v2.6.18
  lk_v2.6.15.x.sts
  lk_v2.6.16.x
  lk_v2.6.16.x.sts
  lk_v2.6.17.x
* master
  origin
[greear@xeon-dt linux-2.6.dev]$ gitk

-- 
Ben Greear <greearb@candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Question on multi-level git repository heiarchy.
@ 2006-10-27 19:26 linux
  0 siblings, 0 replies; 6+ messages in thread
From: linux @ 2006-10-27 19:26 UTC (permalink / raw)
  To: greearb; +Cc: git

The thing to learn is that the operation you are trying to perform
is called "fetch", not "pull".  Pull = fetch + merge.

In fact, the "fetch" part of "git pull" is optional, so it's
best to think of "git pull" as the fundamental *merge* operation.
("git merge" is a helper that you probably don't want to use directly.)

There's a valid argument that this is not good terminology (especially
because "push" is the opposite of "fetch"!), but without getting
into that discussion, there are two ways to do a merge:

- The small-steps way.
  git fetch remote
  git pull . remoteorigin

- The bold, all-at-once way
  git pull remote remoteorigin

The former acutally gives a local name to the remote branch,
then merges it in in a second step.

The latter is what folks like Linus do who aren't carefully following
remote development, but just want to merge it in.  It's better for
one-off access to remote development, because it doesn't clutter your
reporistory with a remote branch name that you're not going to use again.

Generally, I always do the former, and I recommend you do too, until
you're comfortable with making such big leaps.

Just remember:
1) "git fetch" copies from the remote repository to the local one.
   This doesn't change anything locally except for branch heads that
   it's supposed to.  And even there, it's careful.
   In particular, "git fetch" will refuse to modify the current HEAD.

2) "git pull" actually does a merge.  This *does* change the current
   HEAD.  It creates a new commit on the HEAD branch unless:
   - HEAD is already up to date, or
   - HEAD can be fast-forwarded, or
   - The merge fails.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-16  0:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-27  5:12 Question on multi-level git repository heiarchy Ben Greear
2006-10-27  5:25 ` Shawn Pearce
2006-10-27 14:05   ` Ben Greear
2006-10-27 15:31     ` Andy Parkins
2006-11-16  0:43   ` Ben Greear
  -- strict thread matches above, loose matches on Subject: below --
2006-10-27 19:26 linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).