grgit-lsremote

Name

grgit-lsremote - List references in a remote repository

Synopsis

grgit.lsremote()
grgit.lsremote(heads: <boolean>, tags: <boolean>, remote: '<name or uri>')
grgit.lsremote {
  heads = <boolean>
  tags = <boolean>
  remote = '<name or uri>'
}

Description

Returns a Map<Ref, String> (Ref) containing references available in the remote, and the object ID they currently point to.

Options

heads

(boolean, default false) Limit to refs/heads. This is not mutually exclusive with tags; when given both, references stored in both places are returned.

tags

(boolean, default false) Limit to refs/tags. This is not mutually exclusive with heads; when given both, references stored in both places are returned.

remote

(String, default 'origin') The name of the remote or the URI of the repository to list.

Examples

Code
grgit.lsremote(tags: true).each { ref, id ->
  println "${id} ${ref.fullName}"
}
Output
d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2