Package org.eclipse.jgit.api
Class RemoteAddCommand
- All Implemented Interfaces:
Callable<RemoteConfig>
Used to add a new 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:
-
Field Summary
FieldsFields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RemoteAddCommand
(Repository repo) Constructor for RemoteAddCommand. -
Method Summary
Modifier and TypeMethodDescriptioncall()
The name of the remote to add.The URL of the repository for the new remote.Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
Field Details
-
name
-
uri
-
-
Constructor Details
-
RemoteAddCommand
Constructor for RemoteAddCommand.- Parameters:
repo
- theRepository
-
-
Method Details
-
setName
The name of the remote to add.- Parameters:
name
- a remote name- Returns:
- this instance
- Since:
- 5.0
-
setUri
The URL of the repository for the new remote.- Parameters:
uri
- an URL for the remote- Returns:
- this instance
- Since:
- 5.0
-
call
Execute the command
Executes the
remote add
command with all the options and parameters collected by the setter methods of this class.- Specified by:
call
in interfaceCallable<RemoteConfig>
- Specified by:
call
in classGitCommand<RemoteConfig>
- Throws:
GitAPIException
-