【问题标题】:Pushing info from a private git server to a service like gitlab将信息从私有 git 服务器推送到 gitlab 之类的服务
【发布时间】:2017-11-17 00:02:56
【问题描述】:

我一直在考虑购买 Bitscope Raspberry Pi 刀片服务器,并想在其上安装 git-core。我想知道是否有办法获取本地存储库并将对该存储库的更改提交给像 gitlab 这样的服务提供商。我想知道这是因为我想要一个完整的所有代码的非现场版本。这可能吗?

【问题讨论】:

  • 所以您希望将存储库从本地服务器“同步”到 gitlab.com?
  • 是的,有没有办法做到这一点?

标签: git repository git-remote


【解决方案1】:

以下有两种选择。


本地两个遥控器

你可以在本地添加两个遥控器

git remote add blade https://example.com/user/repo.git
git remote add gitlab https://gitlab.com/user/repo.git

(假设您尚未添加任何遥控器 - 如果您只是添加了缺少的遥控器)。

然后就可以执行了

git push blade {branch-name}
git push gitlab {branch-name}

当你想分别推送到两个单独的遥控器时。


刀片服务器上的额外远程

要添加遥控器,您可以运行:

git remote add gitlab https://gitlab.com/user/repo.git

然后就可以执行了

git push gitlab {branch-name}

推送到 gitlab

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    • 1970-01-01
    • 2013-06-04
    • 2014-03-24
    • 1970-01-01
    相关资源
    最近更新 更多