【问题标题】:need more understanding on gitblit groovy push script需要更多了解 gitblit groovy push 脚本
【发布时间】: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 的手册页(或文档)中查找
  • 谢谢,但就我而言,如果我使用setPushAllforce=true 会发生什么情况?如果不是?
  • 我不明白你在追求什么。这个命令就像git push --all --force。文档解释了这两个项目。
  • setForce(true) 将使用源 repo 中的引用覆盖目标 repo 中的引用。对于您的情况,这可能是您想要的。
  • setPushAll 会将所有分支从源推送到目标。这也可能是你想要的。

标签: java git groovy repository gitblit


【解决方案1】:

在评论中回答了我想知道的问题

Git only pushes what is not in the target

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

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多