Class RemoteSetUrlCommand

  • All Implemented Interfaces:
    java.util.concurrent.Callable<RemoteConfig>

    public class RemoteSetUrlCommand
    extends GitCommand<RemoteConfig>
    Used to change the URL of a remote. This class has setters for all supported options and arguments of this command and a call() method to finally execute the command.
    Since:
    4.2
    See Also:
    Git documentation about Remote
    • Constructor Detail

      • RemoteSetUrlCommand

        protected RemoteSetUrlCommand​(Repository repo)

        Constructor for RemoteSetUrlCommand.

        Parameters:
        repo - the Repository
    • Method Detail

      • setName

        @Deprecated
        public void setName​(java.lang.String name)
        Deprecated.
        The name of the remote to change the URL for.
        Parameters:
        name - a remote name
      • setRemoteName

        public RemoteSetUrlCommand setRemoteName​(java.lang.String remoteName)
        The name of the remote to change the URL for.
        Parameters:
        remoteName - a remote remoteName
        Returns:
        this
        Since:
        5.3
      • setRemoteUri

        public RemoteSetUrlCommand setRemoteUri​(URIish remoteUri)
        The new URL for the remote.
        Parameters:
        remoteUri - an URL for the remote
        Returns:
        this
        Since:
        5.3
      • setUriType

        public RemoteSetUrlCommand setUriType​(RemoteSetUrlCommand.UriType type)
        Whether to change the push URL of the remote instead of the fetch URL.
        Parameters:
        type - the UriType value to set
        Returns:
        this
        Since:
        5.3