如何从本地创建远程Git存储库? [英] How to create a remote Git repository from a local one?
本文介绍了如何从本地创建远程Git存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个本地Git存储库。我想让它在远程的,启用ssh的服务器上可用。我怎么做到这一点?
I have a local Git repository. I would like to make it available on a remote, ssh-enabled, server. How do I do this?
推荐答案
我认为你在远程端创建一个裸仓库, git init --bare
,将远程端添加为本地存储库的推/拉跟踪器( git remote add origin URL
),然后在本地你只需说 git push origin master
。现在任何其他仓库都可以从远程仓库中 pull
。
I think you make a bare repository on the remote side, git init --bare
, add the remote side as the push/pull tracker for your local repository (git remote add origin URL
), and then locally you just say git push origin master
. Now any other repository can pull
from the remote repository.
这篇关于如何从本地创建远程Git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文