git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linux@horizon.com
To: greearb@candelatech.com
Cc: git@vger.kernel.org
Subject: Re: Question on multi-level git repository heiarchy.
Date: 27 Oct 2006 15:26:37 -0400	[thread overview]
Message-ID: <20061027192637.8885.qmail@science.horizon.com> (raw)

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.


             reply	other threads:[~2006-10-27 19:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-27 19:26 linux [this message]
  -- strict thread matches above, loose matches on Subject: below --
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061027192637.8885.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=git@vger.kernel.org \
    --cc=greearb@candelatech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).