def https_url_to_ssh_url(url: str) -> str:
    """Convert https url to git ssh url

    :param url:  https url to be converted
    :return: Returns git ssh url as string
    """

    if ".git" in url[-4:]:
        return url.replace("https://", "git@").replace("/", ":", 1)
    return url.replace("https://", "git@").replace("/", ":", 1) + ".git"