diff --git a/pygerrit/client.py b/pygerrit/client.py
index <HASH>..<HASH> 100644
--- a/pygerrit/client.py
+++ b/pygerrit/client.py
@@ -34,6 +34,8 @@ from pygerrit.models import Change
 from pygerrit.ssh import GerritSSHClient
 from pygerrit.stream import GerritStream
 
+_GERRIT_VERSION_PREFIX = "gerrit version "
+
 
 class GerritClient(object):
 
@@ -44,6 +46,21 @@ class GerritClient(object):
         self._events = Queue()
         self._stream = None
         self._ssh_client = GerritSSHClient(host)
+        self._gerrit_version = self._get_gerrit_version()
+
+    def _get_gerrit_version(self):
+        """ Run `gerrit version` to get the version of Gerrit connected to.
+
+        Return the version as a string.  Empty if version was not returned.
+
+        """
+        _stdin, stdout, _stderr = self._ssh_client.run_gerrit_command("version")
+        version_string = stdout.read()
+        if version_string:
+            if version_string.startswith(_GERRIT_VERSION_PREFIX):
+                return version_string[len(_GERRIT_VERSION_PREFIX):].strip()
+            return version_string.strip()
+        return ""
 
     def query(self, term):
         """ Run `gerrit query` with the given term.
Get Gerrit version during client initialisation

Later the client might have functionality that only works on
certain versions of Gerrit.  Store the Gerrit version during
initialisation.

Change-Id: Idcd<I>baf<I>d6cd<I>f6f<I>b<I>c4b0a0c<I>b