0

Is it possible to create a Tag in git while committing and pushing the change using the grgit plugin ...??

This is my code to push my changes to git ..

task pushChangestoGit()
{
    def grgit = org.ajoberstar.grgit.Grgit.open(dir: '.')
    grgit.add(patterns: ['version.properties'])
    grgit.commit(message: 'Committing Version Property Changes')
    grgit.push(force: true)
}
Spencer Bharath
  • 507
  • 2
  • 7
  • 21
  • What do you mean by creating a tag while committing and pushing? Tag as part of the commit and before push, or tag simultaneously using different terminal? – Crazyjavahacking Aug 10 '16 at 15:05
  • Thanks @ Crazyjavahacking .. I just want to know is it possible to create a tag using gr git plugin for gradle – Spencer Bharath Aug 10 '16 at 16:06

1 Answers1

1

Yes, you can do it by:

grgit.tag.add(name: 'tag-name', pointsTo: 'changeset')
Crazyjavahacking
  • 9,343
  • 2
  • 31
  • 40