{"thread":{"id":"43655","subject":"Re: Question on multi-level git repository heiarchy.","startedAt":"2006-10-27T19:26:37Z","lastAt":"2006-10-27T19:26:37Z","messageCount":1,"participants":["linux@horizon.com"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"296367","messageId":"20061027192637.8885.qmail@science.horizon.com","threadId":"43655","inReplyTo":null,"subject":"Re: Question on multi-level git repository heiarchy.","fromName":"","fromEmail":"linux@horizon.com","sentAt":"2006-10-27T19:26:37Z","receivedAt":"2006-10-27T19:26:37Z","isPatch":false,"sender":{"key":"linux@horizon.com","avatar":null},"body":"The thing to learn is that the operation you are trying to perform\nis called \"fetch\", not \"pull\".  Pull = fetch + merge.\n\nIn fact, the \"fetch\" part of \"git pull\" is optional, so it's\nbest to think of \"git pull\" as the fundamental *merge* operation.\n(\"git merge\" is a helper that you probably don't want to use directly.)\n\nThere's a valid argument that this is not good terminology (especially\nbecause \"push\" is the opposite of \"fetch\"!), but without getting\ninto that discussion, there are two ways to do a merge:\n\n- The small-steps way.\n  git fetch remote\n  git pull . remoteorigin\n\n- The bold, all-at-once way\n  git pull remote remoteorigin\n\nThe former acutally gives a local name to the remote branch,\nthen merges it in in a second step.\n\nThe latter is what folks like Linus do who aren't carefully following\nremote development, but just want to merge it in.  It's better for\none-off access to remote development, because it doesn't clutter your\nreporistory with a remote branch name that you're not going to use again.\n\nGenerally, I always do the former, and I recommend you do too, until\nyou're comfortable with making such big leaps.\n\nJust remember:\n1) \"git fetch\" copies from the remote repository to the local one.\n   This doesn't change anything locally except for branch heads that\n   it's supposed to.  And even there, it's careful.\n   In particular, \"git fetch\" will refuse to modify the current HEAD.\n\n2) \"git pull\" actually does a merge.  This *does* change the current\n   HEAD.  It creates a new commit on the HEAD branch unless:\n   - HEAD is already up to date, or\n   - HEAD can be fast-forwarded, or\n   - The merge fails.\n\n"}]}