我想设置一个将由其他人克隆的git repo。这个服务器就是gitserver.com。
所以在gitserver.com〜/ nodejs / project的项目目录中,我做了git init,git add和git commit。
现在要在另一台机器上克隆它,我尝试了以下方法: -
git clone ssh://root@gitserver.com/nodejs/project
git clone ssh://root@gitserver.com/nodejs/project.git
git clone git://root@gitserver.com/nodejs/project
git clone git://root@gitserver.com/nodejs/project.git
但是我收到了这个错误 -
克隆到'项目'......致命:'/ nodejs/project.git'没有出现 成为一个致命的git存储库:无法从远程存储库中读取。
请确保您拥有正确的访问权限和存储库 存在。
所以我错过了任何一步吗?如何获取在gitserver.com中创建的仓库的URL?
答案 0 :(得分:1)
本地和远程git repos之间存在差异。远程,它是中央存储库的起源。
在〜远程/项目目录
git init --bare
转到您的本地目录
git remote add origin~ / remote / project
git commit -a -m"初始提交"
git push -u origin master