def rename(self, new_name: str) -> "Remote":
        """Rename self to the given `new_name`.

        :return:
            self
        """
        if self.name == new_name:
            return self

        self.repo.git.remote("rename", self.name, new_name)
        self.name = new_name
        self._clear_cache()

        return self
Rename self to the given `new_name`.

        :return:
            self
        
git/remote.py