【问题标题】:In Jenkins, how to mirror a repository to another (using Git)?在 Jenkins 中,如何将存储库镜像到另一个存储库(使用 Git)?
【发布时间】:2016-06-14 21:33:31
【问题描述】:

基本上我想做的是将一个开源 git 存储库镜像到我自己的 git 存储库。 命令应该是:

git clone --mirror target@github.com/target.git
cd target.git
git remote set-url --push origin %my_repo%
git fetch -p origin
git push --mirror

但是,我在 Jenkins 上找不到执行上述命令的方法。 谁能给我指路? 谢谢。

【问题讨论】:

    标签: git github jenkins jenkins-plugins


    【解决方案1】:

    使用 Github fork 可能是最好的,但在 Jenkins 中,您可以使用 GitSCM 插件来引用本地裸副本。

    https://support.cloudbees.com/hc/en-us/articles/115001728812-Using-a-Git-reference-repository

    【讨论】:

    • 这是边界线link-only answer。您应该在此处扩展您的答案以包含尽可能多的信息,并使用该链接仅供参考。
    猜你喜欢
    • 2012-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-16
    • 1970-01-01
    • 2023-04-06
    • 2015-09-14
    • 2020-10-25
    相关资源
    最近更新 更多