def create(cls, repo: "Repo", name: str, url: str, allow_unsafe_protocols: bool = False, **kwargs: Any) -> "Remote":
        """Create a new remote to the given repository.

        :param repo:
            Repository instance that is to receive the new remote.

        :param name:
            Desired name of the remote.

        :param url:
            URL which corresponds to the remote's name.

        :param allow_unsafe_protocols:
            Allow unsafe protocols to be used, like ``ext``.

        :param kwargs:
            Additional arguments to be passed to the ``git remote add`` command.

        :return:
            New :class:`Remote` instance

        :raise git.exc.GitCommandError:
            In case an origin with that name already exists.
        """
        scmd = "add"
        kwargs["insert_kwargs_after"] = scmd
        url = Git.polish_url(url)
        if not allow_unsafe_protocols:
            Git.check_unsafe_protocols(url)
        repo.git.remote(scmd, "--", name, url, **kwargs)
        return cls(repo, name)
Create a new remote to the given repository.

        :param repo:
            Repository instance that is to receive the new remote.

        :param name:
            Desired name of the remote.

        :param url:
            URL which corresponds to the remote's name.

        :param allow_unsafe_protocols:
            Allow unsafe protocols to be used, like ``ext``.

        :param kwargs:
            Additional arguments to be passed to the ``git remote add`` command.

        :return:
            New :class:`Remote` instance

        :raise git.exc.GitCommandError:
            In case an origin with that name already exists.
        
git/remote.py