如何使用JGit等效于"git push --mirror ..."? [英] How To Use JGit To Do Equivalent Of "git push --mirror ..."?

查看:89
本文介绍了如何使用JGit等效于"git push --mirror ..."?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个简单的应用程序,该应用程序从Java域执行"git push --mirror"操作.

I'm trying to create a simple application that executes a "git push --mirror" operation from the Java domain.

JGit库,特别是 PushCommand 类,即使它支持"--all"和"--tags",似乎也不支持"--mirror"选项.

The JGit library, specifically the PushCommand class, doesn't seem to support the "--mirror" option even though it supports "--all" and "--tags".

我错过了什么吗?我们如何使用JGit进行"git push --mirror ..."?

Am I missing something? How do we use JGit to do "git push --mirror ..."?

推荐答案

使用以下参考规范手动尝试:

Try it manually by using the following ref spec:

git.push().setRefSpecs(new RefSpec("+refs/*:refs/*")).call();

这篇关于如何使用JGit等效于"git push --mirror ..."?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆