Java 需要更多了解gitblit groovy推送脚本吗

Java 需要更多了解gitblit groovy推送脚本吗,java,git,groovy,repository,gitblit,Java,Git,Groovy,Repository,Gitblit,我有下面的groovy脚本 PushCommand push=git.push(); push.setRemote("my remote"); push.setPushAll(); //Push all branches under refs/heads/*. push.setForce(true); //Sets the force preference for push operation. push.call(); 我的要求:只想将更改从一个gitinstance推送到另一个 setPu

我有下面的
groovy脚本

PushCommand push=git.push();
push.setRemote("my remote");
push.setPushAll(); //Push all branches under refs/heads/*.
push.setForce(true); //Sets the force preference for push operation.
push.call();
我的要求:
只想将更改从一个gitinstance推送到另一个

setPushAll
:这将在脚本执行的所有时间推送所有存储库数据,还是仅提交更改(我只希望更改)


push.setForce(true)
:这有什么用?我应该在我的案例中使用它吗?

在评论中得到了我想要知道的答案

Git只推送目标中没有的内容

setForce(true)
将用源回购中的引用覆盖目标回购中的引用。对于您的情况,这可能是您想要的<代码>詹姆斯·莫格


setPushAll
将所有分支从源推送到目标。这可能也是你想要的<代码>詹姆斯·莫格


您可以在-
cfrick

git的手册页(或文档)中查找,git只会推动差异(如果您关心数据量)。和强制你可以在git push的手册页(或文档)中查找谢谢,但是在我的情况下,如果我使用
setPushAll
&
force=true
,你能告诉我会发生什么吗?如果不是,另一边?我不明白你在找什么。这个命令类似于
gitpush--all--force
。文档解释了这两个项目。
setForce(true)
将用源回购中的引用覆盖目标回购中的引用。对于您的情况,这可能是您想要的。
setPushAll
将所有分支从源推送到目标。这可能也是你想要的。