【问题标题】:Push online repo to bitbucket将在线 repo 推送到 bitbucket
【发布时间】:2016-06-03 10:32:57
【问题描述】:

我正在使用 sourcetree,并希望将我的工作连同其提交历史移至源树上的另一个帐户,以便更多人可以访问它。它是目标帐户上另一个 repo 的克隆,但我需要展示它是如何演变的,以便其他人可以追踪错误。

我在谷歌上搜索了许多不同的组合,包括这篇文章的确切标题,但找不到任何告诉你如何做到这一点的地方。我得到的只是关于如何: 创建一个仓库

上传一个新的仓库

将现有仓库上传到新仓库

将现有仓库克隆到新仓库

但不是如何:

将现有仓库克隆到另一个仓库

将现有的 repo 克隆为另一个 repo 的分支

我知道这是可以做到的,因为我以前做过,但那次是 8 小时的 google 会话,我真的不想再经历一次......

请帮帮我!

【问题讨论】:

    标签: git macos svn github sourcetree


    【解决方案1】:

    我认为您在尝试复制远程存储库时陷入困境,因为您坚持该操作必须是服务器上的直接副本。不必如此。正如blog 所讨论的那样,您可以通过在本地克隆存储库、在 BitBucket 上创建一个新存储库,然后简单地将您的代码推送到这个新存储库来实现您想要的:

    # change directory to location of copy
    mkdir NEW-PROJECT.git
    cd NEW-PROJECT.git
    
    # create a local copy of the repository
    git clone --bare https://username@bitbucket.org/username/OLD-PROJECT.git
    
    # now create an empty repository on BitBucket called NEW-PROJECT
    
    # push your entire code base to this new repository
    git push --mirror https://username@bitbucket.org/username/NEW-PROJECT.git
    

    【讨论】:

      猜你喜欢
      • 2015-01-05
      • 2017-01-10
      • 2018-03-06
      • 1970-01-01
      • 1970-01-01
      • 2019-01-30
      • 2015-06-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多