def METHOD_NAME(self) -> Path:
    """Retrieve the git repository from it's remote location."""
    from git.repo import Repo  # pylint: disable=import-outside-toplevel
    ref = self.__determine_git_ref()
    dir_name = "_".join([self.sanitize_git_path(self.uri), ref])
    cached_dir_path = self.cache_dir / dir_name
    if cached_dir_path.exists():
        return cached_dir_path
    with tempfile.TemporaryDirectory() as tmpdirname:
        tmp_repo_path = Path(tmpdirname) / dir_name
        with Repo.clone_from(self.uri, str(tmp_repo_path)) as repo:
            repo.head.set_reference(ref)
            repo.head.reset(index=True, working_tree=True)
        shutil.move(str(tmp_repo_path), self.cache_dir)
    return cached_dir_path