Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 当ssh';去遥控器?_Git_Repository_Remote Access - Fatal编程技术网

Git 当ssh';去遥控器?

Git 当ssh';去遥控器?,git,repository,remote-access,Git,Repository,Remote Access,我想更改远程分支的端口。我执行了这个命令 localhost:myproject satishp$ git remote add production rails@my-project.com:7822:/home/rails/myproject 然而,当我尝试推到那个分支时,我收到了关于端口22未打开的投诉。这是真的。它没有打开,但这就是我在上面的声明中试图更改端口的原因 localhost:myproject satishp$ git push production master ssh:

我想更改远程分支的端口。我执行了这个命令

localhost:myproject satishp$ git remote add production rails@my-project.com:7822:/home/rails/myproject
然而,当我尝试推到那个分支时,我收到了关于端口22未打开的投诉。这是真的。它没有打开,但这就是我在上面的声明中试图更改端口的原因

localhost:myproject satishp$ git push production master
ssh: connect to host my-project.com port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

如何正确更改遥控器的端口?这是在Mac上的Git v 2.62上实现的,如果taht很重要。

ssh://
URL中允许使用端口,但在
scp
中不允许。要修复:

git remote set-url production ssh://rails@my-project.com:7822/home/rails/myproject