如何为Git创建两个远程源? [英] How to have two remote origins for Git?

查看:344
本文介绍了如何为Git创建两个远程源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司是一个小型的公司,我们将使用Git进行版本控制。主服务器将是本地的。但我们确实需要一个服务器,让我们的本地回购网站保持在线状态,以便访问我们的客户,以便他们能够保证我们正在做正确的事情并允许他们在需要时从那里退房。

My company is a small one where we would be using Git for version control. The main server will be local. But we do want an server where our local repo is kept online to give access to our clients so that they can have assurance that we are doing the right thing and to allow them to check out from there if needed.

因此,如果我只是希望只推到外面的一个,并且永远不会从中拉出来,那么最好的Git方法是什么?

So if I simply wish to push only to the one outside, and will never pull from it, what is the best Git way to do this?

推荐答案

您可以使用 git remote add< name> < url>

然后,您可以使用 git push< name> master:master 将本地主分支推送到远程主分支。

You can then push to a remote with git push <name> master:master to push your local master branch to the remote master branch.

当您使用 git创建回购克隆远程名为 origin ,但您可以为您的在线服务器创建 public 存储库并使用推送它。git push public master:master

When you create a repo with git clone the remote is named origin but you can create a public repository for your online server and push to it with git push public master:master

这篇关于如何为Git创建两个远程源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆