def github_repository_name(url):
    """
    Get the repository name from a Github URL
    """
    repo = url.rstrip("/")

    if repo.endswith(".git"):
        repo = repo[:-4]

    _, name = repo.rsplit("/", 1)

    return name