简体   繁体   English

如何将本地git存储库克隆到服务器上的存储库?

[英]How to clone a local git repository to a repository on the server?

I am currently using this command :: 我目前正在使用此命令::

git clone --bare path/in/local ssh://path/in/server git clone --bare path / in / local ssh:// path / in / server

But this command is creating a new git folder named ssh://path/in/server in my local system and then cloning the local git repository in it. 但是这个命令在我的本地系统中创建一个名为ssh:// path / in / server的新git文件夹,然后在其中克隆本地git存储库。

So,I need to know if there is a way to have it done using the git clone command specifically. 所以,我需要知道是否有办法专门使用git clone命令完成它。

git clone can only create local repositories. git clone只能创建本地存储库。

If you want to create a repository elsewhere, you'll need to create an empty repository on the remote machine (for that you typically need shell access or some kind of admin interface), then add it as a remote in your local repo and push to it. 如果要在其他地方创建存储库,则需要在远程计算机上创建一个空存储库(为此通常需要shell访问或某种管理界面),然后将其作为远程数据库添加到本地存储库中并推送它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM