定义您的遥控器,使其使用端口 443,或设置您的 ssh 配置,使其知道对该主机使用端口 443。
git remote add origin ssh://some.host:443/path/to/repo.git
Run Code Online (Sandbox Code Playgroud)
首先,git将在shell中执行命令,它将查找环境变量HOME(它不是Windows标准的环境变量).
因此,请确保它确实引用了正确的路径(您想要的任何路径)
然后ssh将查找您的公钥和私钥~/.ssh/id_rsa(.pub).
确保你有它们(你可以在Git bash会话中生成它们:ssh-keygen -t rsa.
确保你在' authorized_keys'中复制了公钥(你有,因为你可以在服务器上ssh)
最后,在您的HOME/.ssh目录中,创建一个名为' config' 的文件:
host remoteServer
user yourLogin
hostname remoteServerName
port 443
identityfile ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
然后你应该能够使用git pull或git push
git pull remoteServer:/path/to/repo.git
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8190 次 |
| 最近记录: |