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)
Constructor for TagCommand.
|
| Modifier and Type | Method and Description |
|---|---|
Ref |
call() |
String |
getMessage()
Get the tag
message. |
String |
getName()
Get the tag
name. |
RevObject |
getObjectId()
Get the tag's object id
|
PersonIdent |
getTagger()
Get the
tagger who created the tag. |
boolean |
isAnnotated()
Whether this will create an annotated command
|
boolean |
isForceUpdate()
Whether this is a forced update
|
boolean |
isSigned()
Whether this tag is signed
|
TagCommand |
setAnnotated(boolean annotated)
Configure this tag to be created as an annotated tag
|
TagCommand |
setForceUpdate(boolean forceUpdate)
If set to true the Tag command may replace an existing tag object.
|
TagCommand |
setMessage(String message)
Set the tag
message. |
TagCommand |
setName(String name)
Set the tag
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)
Constructor for TagCommand.
repo - a Repository object.public Ref call() throws GitAPIException, ConcurrentRefUpdateException, InvalidTagNameException, NoHeadException
Execute the command
Executes the 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>GitAPIExceptionConcurrentRefUpdateExceptionInvalidTagNameExceptionNoHeadExceptionpublic TagCommand setName(String name)
name.name - the tag name used for the tagthispublic String getName()
name.tagpublic String getMessage()
message.tagpublic TagCommand setMessage(String message)
message.message - the tag message used for the tagthispublic boolean isSigned()
public TagCommand setSigned(boolean signed)
signed - a boolean.thispublic TagCommand setTagger(PersonIdent tagger)
tagger - a PersonIdent object.thispublic PersonIdent getTagger()
tagger who created the tag.public RevObject getObjectId()
public TagCommand setObjectId(RevObject id)
id - a RevObject object.thispublic boolean isForceUpdate()
public TagCommand setForceUpdate(boolean forceUpdate)
forceUpdate - whether this is a forced updatethispublic TagCommand setAnnotated(boolean annotated)
annotated - whether this shall be an annotated tagthispublic boolean isAnnotated()
Copyright © 2018 Eclipse JGit Project. All rights reserved.