Retrieving the Git Server Version

Is there a general way to get the git version string if I don't have shell access on the server?

I work in an environment where I have to test all the software I work with. If I continue to use 1.9.4 for years, then at some point in the future, is there any chance that git-receive-pack or some such program is making the change? i.e. my local git version stops working one day. To prevent this from happening, I would like to know immediately when something is updated on the server.

+3


source to share


1 answer


The short answer is no: if you do not control (or have sufficient access) to the server, you cannot force them to make changes. That would be true even if you could ask them about their version. We just assume that you are not in control of the server, so if there is a way to query the server regarding the version there, they might just be lying.

However, at least so far, all changes to git protocol handling have been done in such a way that older versions of git can talk to newer ones, and vice versa, within reason (see below). Moreover, while you cannot get a specific version of git, you can tell something about the server from the protocol support flags.

See this section on git Pro which includes the following:



0088ca82a6dff817ec66f44342007202690a93763949 HEAD\0multi_ack thin-pack \
  side-band side-band-64k ofs-delta shallow no-progress include-tag

      

These lines are separated by spaces ( multi_ack

, thin-pack

etc.), it is determined which options are available. If, for example, is shallow

not displayed, you can tell that the server version has exceeded git 1.5.0. This would mean that if you had a shallow clone (or wanted to make one) because you have a new git, you won't be able to communicate with the server, but you know why, since your git would say "Server does not support small clients ".

+1


source







All Articles