public class TagCommand extends GitCommand<Ref>
Examples (git is a Git instance):
Create a new tag for the current commit:
git.tag().setName("v1.0").setMessage("First stable release").call();
Create a new unannotated tag for the current commit:
git.tag().setName("v1.0").setAnnotated(false).call();
repo| Modifier | Constructor and Description |
|---|---|
protected |
TagCommand(Repository repo) |
| Modifier and Type | Method and Description |
|---|---|
Ref |
call()
Executes the
tag command with all the options and parameters
collected by the setter methods of this class. |
String |
getMessage() |
String |
getName() |
RevObject |
getObjectId() |
PersonIdent |
getTagger() |
boolean |
isAnnotated() |
boolean |
isForceUpdate() |
boolean |
isSigned() |
TagCommand |
setAnnotated(boolean annotated) |
TagCommand |
setForceUpdate(boolean forceUpdate)
If set to true the Tag command may replace an existing tag object.
|
TagCommand |
setMessage(String message) |
TagCommand |
setName(String name) |
TagCommand |
setObjectId(RevObject id)
Sets the object id of the tag.
|
TagCommand |
setSigned(boolean signed)
If set to true the Tag command creates a signed tag object.
|
TagCommand |
setTagger(PersonIdent tagger)
Sets the tagger of the tag.
|
checkCallable, getRepository, setCallableprotected TagCommand(Repository repo)
repo - public Ref call() throws GitAPIException, ConcurrentRefUpdateException, InvalidTagNameException, NoHeadException
tag command with all the options and parameters
collected by the setter methods of this class. Each instance of this
class should only be used for one invocation of the command (means: one
call to call())call in interface Callable<Ref>call in class GitCommand<Ref>Ref a ref pointing to a tagNoHeadException - when called on a git repo without a HEAD referenceGitAPIException - or subclass thereof when an error occursConcurrentRefUpdateExceptionInvalidTagNameExceptionpublic TagCommand setName(String name)
name - the tag name used for the tagthispublic String getName()
tagpublic String getMessage()
tagpublic TagCommand setMessage(String message)
message - the tag message used for the tagthispublic boolean isSigned()
public TagCommand setSigned(boolean signed)
signed - thispublic TagCommand setTagger(PersonIdent tagger)
tagger - thispublic PersonIdent getTagger()
public RevObject getObjectId()
public TagCommand setObjectId(RevObject id)
id - thispublic boolean isForceUpdate()
public TagCommand setForceUpdate(boolean forceUpdate)
forceUpdate - thispublic TagCommand setAnnotated(boolean annotated)
annotated - thispublic boolean isAnnotated()
Copyright © 2014. All rights reserved.