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