【发布时间】:2015-08-15 18:37:30
【问题描述】:
我下面有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();
我的要求:want to push only changes from one gitinstance to other
setPushAll :这是要在脚本执行时推送所有存储库数据还是只是提交更改(我只想要更改)?
push.setForce(true):这个有什么用?我应该在我的情况下使用它吗?
【问题讨论】:
-
git 只推送差异(如果您关心数据量)。并强制您可以在 git-push linux.die.net/man/1/git-push 的手册页(或文档)中查找
-
谢谢,但就我而言,如果我使用
setPushAll和force=true会发生什么情况?如果不是? -
我不明白你在追求什么。这个命令就像
git push --all --force。文档解释了这两个项目。 -
setForce(true)将使用源 repo 中的引用覆盖目标 repo 中的引用。对于您的情况,这可能是您想要的。 -
setPushAll会将所有分支从源推送到目标。这也可能是你想要的。
标签: java git groovy repository gitblit