def METHOD_NAME(self) -> str:
    "Return the latest commit SHA of the remote branch."
    # we rely on the smart HTTPS protocol for Git served by Github
    # https://www.git-scm.com/docs/http-protocol
    #
    # Responses look like this:
    #
    # S: 200 OK
    # S: Content-Type: application/x-git-upload-pack-advertisement
    # S: Cache-Control: no-cache
    # S:
    # S: 001e# service=git-upload-pack\n
    # S: 0000
    # S: 004895dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint\0multi_ack\n
    # S: 003fd049f6c27a2244e12041955e262a404c7faba355 refs/heads/master\n
    # S: 003c2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0\n
    # S: 003fa3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}\n
    # S: 0000
    uri = self.github_url + "/info/refs?service=git-upload-pack"
    resp = requests.get(uri)
    resp.raise_for_status()
    lines = resp.content.decode("latin-1").splitlines()
    for line in lines:
        # XXX some repos now use "main" instead of "master"
        if line.count(" ") == 1 and line.endswith("refs/heads/master"):
            # the first four bytes are the line length, ignore them
            sha = line.split(" ")[0][4:]
            return cast(str, sha)
    raise Exception("Could not find latest remote SHA in response")