Re: [git] how to check remote git repo for updates without pull/fetch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ivan Zorin <ivan.a.zorin@xxxxxxxxx> wrote:
> Hello. I have not very hard question, but I don't know how to better do
> it - could you tell me, please, does exist some way to check remote git
> repository for updates without downloading any essential files? I
> suppose, that such command should just type something like: "already
> updated", if current working tree identical to remote repo, and
> something like "there is some updates in remote repo", if remote repo
> has some new commits and/or branches. Thanks.

There aren't any commands to do it.

What you could do is write a script based upon git ls-remote. A
really simple one might be:

	#!/bin/sh
	remote=$1
	o=.git/remote_cache.$remote
	n=$o.new$$
	git ls-remote $remote >$n
	if [ -f $o ]
	then
		if diff $o $n >/dev/null
		then
			echo "No changes"
		else
			mv $n $o
			echo "Updates available"
	else
		mv $n $o
		echo "New remote remembered..."
	fi

A much more complex one would actually rewrite refs/heads/ to
the correct refs/remotes/ namespace on your local repository and
compare the remote ref values to the local refs/remotes values.

Patches for git fetch --pretend or something might be interesting.
Though I recall a thread about this before on the MLand saying there
was no point.  Its not like you can see how big the download would
be until after its over.

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux