【问题标题】:git push master to server with sshgit 使用 ssh 将 master 推送到服务器
【发布时间】: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 名称?

【问题讨论】:

    标签: git ssh push


    【解决方案1】:

    必须是 git init 还是 git init --bare?

    光秃秃的。请参阅difference

    服务器上的 git repo 是否需要有相同的文件夹名称或 git repo 名称?

    不,任何名字都可以。

    ssh user@IP "
    cd /folder
    git init --bare repo.git"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-26
      • 2017-02-15
      • 2015-03-14
      • 2020-09-12
      • 1970-01-01
      • 1970-01-01
      • 2021-11-23
      • 2013-06-04
      相关资源
      最近更新 更多