Setup Git Remote SSH (git-upload-pack / git-receive-pack)

后端 未结 2 1036
不知归路
不知归路 2021-01-19 08:59

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

相关标签:
2条回答
  • 2021-01-19 09:56

    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.

    0 讨论(0)
  • 2021-01-19 09:58

    You need the binaries git-upload-pack & git-receive-pack in the path on the remote while an ssh is being executed.

    If not configure them for every remote link in your repository like this

    git config remote.origin.uploadpack /somepath/git/git-upload-pack
    git config remote.origin.receivepack /somepath/git/git-receive-pack
    

    where origin is the remote.

    0 讨论(0)
提交回复
热议问题