【问题标题】:git push all remote branches to a new origingit 将所有远程分支推送到新的原点
【发布时间】:2015-07-17 16:25:31
【问题描述】:

假设我有一个从远程 A 克隆的存储库,现在我希望所有远程 A 分支都克隆到远程 B 存储库。我曾尝试使用git push --mirror,但没有成功。我该如何解决这个问题?

【问题讨论】:

    标签: git push clone mirror


    【解决方案1】:

    设置新原点后:

    git remote set-url origin git://new.url.here
    

    我用过:

    git push origin refs/remotes/origin/*:refs/heads/*
    

    【讨论】:

    • 建议将路径名放在引号中,因为某些shell会混淆星号...stackoverflow.com/questions/37564353/…
    • 正如@wayofthefuture 所指出的,TCSH 抛出git: No match.。双引号技巧有效:git push origin "refs/remotes/origin/*:refs/heads/*"
    猜你喜欢
    • 2011-09-10
    • 2016-07-08
    • 1970-01-01
    • 2014-02-04
    • 2019-02-26
    • 2012-07-25
    • 2020-12-31
    • 1970-01-01
    • 2016-10-25
    相关资源
    最近更新 更多