【发布时间】:2019-09-20 12:10:42
【问题描述】:
我是 git 新手,我想通过 git 和 ssh-authentification 将 node.js 项目从 ide.goorm.io 推送到 apache 服务器。 (这是从我的服务器提供的。) 在 goorm 中,我能够将我的私钥添加到 ssh-agent。 我初始化了一个 git repo,添加了文件并将它们全部提交。
通过这一行,我尝试将我的项目推送到我的服务器:
git push ssh://user@IP/folder/repo.git/ master
在 repo.git 中是一个 git init --bare 存储库。 (或者只是一个 git init。我都试过了。)
我得到这个错误:
fatal: '/folder/repo.git/' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
如何在服务器上初始化一个新的 repo?它必须是 git init 还是 git init --bare?服务器上的 git repo 是否需要有相同的文件夹名称或 git repo 名称?
【问题讨论】: