需要更多关于gitblit groovy push脚本的理解 [英] need more understanding on gitblit groovy push script

查看:425
本文介绍了需要更多关于gitblit groovy push脚本的理解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面有 groovy脚本

  PushCommand push = git。推(); 
push.setRemote(my remote);
push.setPushAll(); //将所有分支按下refs / heads / *。
push.setForce(true); //设置推送操作的强制偏好。
push.call();

我的要求:只想将更改从一个gitinstance推送到其他 code

$ p $ c $ setPushAll
:这是否会在所有时间脚本执行或刚刚通过时推送所有存储库数据更改(我只想更改)?
$ b preush $ setForce(true):这是什么用途?我应该使用它吗?

解决方案

b

Git只会推送不在目标中的元素



setForce(true)将使用源回购中的引用覆盖目标回购中的引用。对于你的情况,这可能是你想要的。 - James Moger



setPushAll 目标的来源。这也可能是你想要的。 - James Moger



您可以在 git-push - cfrick


I have below groovy script

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();

My requirement: want to push only changes from one gitinstance to other

setPushAll : Is this going to push all repository data all time script executed or just commied changes(I want change only)?

push.setForce(true) : What is use of this ? Should I use it in my case ?

解决方案

Got answer what I want to know As in comment

Git only pushes what is not in the target

setForce(true) will override references in the target repo with the references in the source repo. For your situation this is probably what you want. – James Moger

setPushAll will push all branches from the source to the target. This is also probably what you want. – James Moger

you can lookup in the man-page (or docs) of git-push - cfrick

这篇关于需要更多关于gitblit groovy push脚本的理解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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