0

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 ?

4

1 回答 1

0

得到答案我想知道的如评论

Git only pushes what is not in the target

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

setPushAll会将所有分支从源推送到目标。这也可能是你想要的。– James Moger

您可以在git-push的手册页(或文档)中查找- cfrick

于 2015-06-15T04:48:06.373 回答