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

Re: git: how to figure out with a script what the last commit on remote repo is without fetching it



I've been thinking about how to answer your question properly and I realised
that the answer probably depends on which protocol you are using to pull from
the remote repo. Or more properly, which protocols the remote repo supports.

If it is listening as pure git://, or git+ssh://, then (at least in the latter
case) it is probably running git-shell(1), and so if you can construct a
command that git-shell will accept and will spit out the answer you need, you
may be able to invoke it over ssh. ('ssh remotehost git-shell some-command...')

If it's listening as HTTPS, then you need to fetch something like
'refs/heads/master' under the URI and see whether the resulting sha1 hash
corresponds to one in your local repo.

I might play around with this more Tomorrow.


Reply to: