【发布时间】:2021-05-07 13:30:28
【问题描述】:
我需要使用 grgit API 在我的 groovy 脚本中读取具有以下 git 远程 url 的 .git 文件夹。
url = git@github.com:***/****.git
请帮忙
【问题讨论】:
标签: git-remote grgit
我需要使用 grgit API 在我的 groovy 脚本中读取具有以下 git 远程 url 的 .git 文件夹。
url = git@github.com:***/****.git
请帮忙
【问题讨论】:
标签: git-remote grgit
我可以这样做
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)
【讨论】: