{"thread":{"id":"1107","subject":"git-fetch-pack","startedAt":"2005-07-05T00:08:45Z","lastAt":"2005-07-05T00:08:45Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"5655","messageId":"Pine.LNX.4.58.0507041702590.3570@g5.osdl.org","threadId":"1107","inReplyTo":null,"subject":"git-fetch-pack","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-07-05T00:08:45Z","receivedAt":"2005-07-05T00:08:45Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nOk,\n I've written a \"git-fetch-pack\" along the lines I outlined a few days \nago, ie the person doing the fetching ends up listing the commits it has, \nand then both ends negotiate the missing objects.\n\nIt's probably buggy in many ways, but I actually used it to fetch the last \nmerge with Russell King:\n\n\tremote=$(git-fetch-pack $repo master)\n\tif [ \"$remote\" ]; then\n\t\tgit resolve $(git-rev-parse HEAD) $remote \"Merge $repo\"\n\tfi\n\nends up doing something sane.\n\nIn general, the format is to tell git-fetch-pack where to fetch things\nfrom, and what branch to use (if you give none, or you give multiple, it\ndoes various magic things, you shouldn't do it). It will then fetch and \nunpack the pack, and return the SHA1 corresponding to the remote ref if \neverything was successful.\n\nSo the above will fetch a remote ref, and resolve it (ie it's basically a \nspecialized \"git pull\").\n\n\t\tLinus\n"}]}