0

I need to read .git folder having below git remote url within my groovy script using grgit APIs.

url = git@github.com:***/****.git

Can you please help

1 Answers1

0

I could do as below

import org.ajoberstar.grgit.Grgit

Grgit git = new Grgit()
def gitRoot = project.hasProperty('git.root') ? project.property('git.root') : project.rootProject.projectDir
git = Grgit.open(dir: gitRoot)
System.out.println("git.remote.list().url -->"+git.remote.list().url)