import re


def clean_url(url: str) -> str:
    """Clean up url and remove any embedded credentials, remove trailing .git to normalise git url"""
    cleaned_url = re.sub("//[^@]+@", "//", url)
    cleaned_url = re.sub("\\.git$", "", cleaned_url)
    return cleaned_url