git-fetch-pack

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:01

Ok,
 I've written a "git-fetch-pack" along the lines I outlined a few days 
ago, ie the person doing the fetching ends up listing the commits it has, 
and then both ends negotiate the missing objects.

It's probably buggy in many ways, but I actually used it to fetch the last 
merge with Russell King:

	remote=$(git-fetch-pack $repo master)
	if [ "$remote" ]; then
		git resolve $(git-rev-parse HEAD) $remote "Merge $repo"
	fi

ends up doing something sane.

In general, the format is to tell git-fetch-pack where to fetch things
from, and what branch to use (if you give none, or you give multiple, it
does various magic things, you shouldn't do it). It will then fetch and 
unpack the pack, and return the SHA1 corresponding to the remote ref if 
everything was successful.

So the above will fetch a remote ref, and resolve it (ie it's basically a 
specialized "git pull").

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help