安装Git远程SSH(git-upload-pack / git-receive-pack) [英] Setup Git Remote SSH (git-upload-pack / git-receive-pack)

查看:254
本文介绍了安装Git远程SSH(git-upload-pack / git-receive-pack)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台可以通过SSH访问的服务器,我想在这里放置一个Git origin repo。我刚刚在本地创建了一个--bare --shared回购协议,并将其复制到每个SCP的服务器上。现在我想根据SSH网址克隆这个回购。我试过

  ssh://USERNAME@HOST/folder1/folder2/gifolder.git 
ssh:// USERNAME :PASSWORD@HOST/folder1/folder2/gifolder.git
ssh:// USERNAME @ HOST:PORT / folder1 / folder2 / gifolder.git
ssh:// USERNAME @ HOST:/ folder1 / folder2 / gifolder.git

以及上述的一些更多组合。但是Git总是说:

pre $ 致命的:远程端意外挂起

虽然我已启用每个SSH与USERNAME和PASSWORD连接到HOST。



是可能以我想要的方式使用git,或者我必须设置它完全不同?



更新:



我将Git Extension配置为使用OpenSSH而不是Putty,现在OpenSSH要求我在clone后输入密码。当我输入正确的密码时,出现以下错误:

  bash:git-upload-pack:command not发现

(OpenSSH似乎获得与服务器的连接,因为它要我重新输入我的当我输入其他东西时输入密码)所以。现在我需要解决这个新问题。首先:我没有启用在服务器上安装git。是否可以在不安装git的情况下使git-upload-pack和git-receive-pack可用?

再次感谢



UPDATE2 - SOLUTION:



解决方案是将远程存储库目录作为每个SSH / SFTP的本地目录进行集成。为此,我使用 http://www.expandrive.com/
Thanks $ / $>

解决方案

建立ssh连接时不需要输入密码:

如果您的公钥在〜/ .ssh / authorized_keys上发布,这应该足够了。

如果您的私钥受密码保护,则可能需要密码(在这种情况下,请参阅 ssh守护进程请求密码,那么您可能需要 ssh-agent )。



否则,请参阅无法将Git-push master添加到Github 以获得更多的ssh调试技巧,包括:




  • ssh -vvvT ssh:// USERNAME @ HOST (确保HOME被定义,特别是如果您在Windows上:请参阅 Heroku push master s
  • 检查服务器上sshd的日志(例如在 / var / log / $ b




















    $ b

    Openssh是一个更安全的选择(并且与mysysgit一起打包),但它仍然要求您正确定义%HOME%。

    再次,


    首先:我没有启用git安装服务器。

    是否可以使 git-upload-pack git-receive-pack 没有安装git可用?


    不,不可能。
    $必须安装b $ b

    git ,并在 sshd > ssh daemon在服务器上运行)。






    OP andineupert 在评论中得出结论:


    由于需要在服务器上安装git(我不能),因此我必须将远程repo-dir作为本地目录集成到SSH / SFTP中。
    现在一切正常。



    I have a server with SSH access and I want to place a Git origin repo there. I just created a --bare --shared repo locally and copied it to the server per SCP. Now I wanted to clone this repo per SSH url. I tried

    ssh://USERNAME@HOST/folder1/folder2/gifolder.git
    ssh://USERNAME:PASSWORD@HOST/folder1/folder2/gifolder.git
    ssh://USERNAME@HOST:PORT/folder1/folder2/gifolder.git
    ssh://USERNAME@HOST:/folder1/folder2/gifolder.git
    

    and some more combinations of the above. But Git always says

    "fatal: The remote end hung up unexpectedly"
    

    although I'm enabled to connect per SSH with USERNAME and PASSWORD to HOST.

    Is it possible to work with git in the way I want to, or do I have to setup it completely different?

    UPDATE:

    I configured Git Extension to use OpenSSH instead of Putty and now OpenSSH asks me to enter the password after "clone". When I'm entering the correct password I'm getting the following error:

    bash: git-upload-pack: command not found
    

    (OpenSSH seems to get a connection to the server, because it wants me to re-enter my password when i'm entering something else) So. Now I need to fix that new problem. First of all: I'm not enabled to install git on the server. Is it possible to make "git-upload-pack" and "git-receive-pack" available without installing git?

    Thanks again

    UPDATE2 - SOLUTION:

    The solution was to integrate the remote repository-directory as a local directory per SSH/SFTP. I'm using http://www.expandrive.com/ for that purpose. Thanks

    解决方案

    You shouldn't need to enter a password when establishing an ssh connection:
    If your public key is published on ~/.ssh/authorized_keys, this should be enough.

    You might need a password if your private key is protected by a passphrase (in which case, see "ssh daemon asks for a password", you could need an ssh-agent).

    Otherwise, see "Unable to Git-push master to Github" for more ssh debugging tips, including:

    • ssh -vvvT ssh://USERNAME@HOST (make sure HOME is defined, especially if you are on Windows: see "Heroku push master ssh problem")
    • check the log of the sshd on the server (for instance in /var/log/secure, but it can vary depending on the Os)

    Openssh is a safer choice (and packaged with mysysgit), but it still requires that you define your %HOME% properly.

    Again, ssh -vvvT will help here.

    First of all: I'm not enabled to install git on the server.
    Is it possible to make "git-upload-pack" and "git-receive-pack" available without installing git?

    No, it isn't possible.

    git must be installed, and in the path of sshd (the ssh daemon running on the server).


    The OP andineupert concludes in the comments:

    Due to the need to install git on the server (which I couldn't) I had to integrate the remote repo-dir as a local dir per SSH/SFTP.
    Now everything's working.

    这篇关于安装Git远程SSH(git-upload-pack / git-receive-pack)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆