如何从本地创建远程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.