Fabric git 推送到错误的 IP 地址
Fabric git pushing to wrong ip address
我正在使用 win7 并尝试使用 fabric 将更改推送到 ubuntu 16.04 VPS。到目前为止我有:
env.roledefs = {
'test': ['localhost'],
'dev': ['user@dev.example.com'],
'production': ['deploy@xxx.xx.xx.xx']
}
@roles('production')
def dir():
env.key_filename = '~/.ssh/id_rsa'
local("pip freeze > requirements.txt")
local("git add . --all && git commit -m 'fab'")
local("git push myproject master")
run('pwd')
...
当我运行这个输出是:
$ fab dir
[deploy@xx.xx.xx.xx] Executing task 'dir'
[localhost] local: pip freeze > requirements.txt
[localhost] local: git add . --all && git commit -m 'fab'
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
[master warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
256de92] 'fab'
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
3 files changed, 10 insertions(+), 9 deletions(-)
[localhost] local: git push example master
debug1: Connecting to 198.91.88.101 [198.91.88.101] port 22.
debug1: connect to address 198.91.88.101 port 22: Connection refused
ssh: connect to host 198.91.88.101 port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Fatal error: local() encountered an error (return code 128) while executing 'git push example master'
所以 fabric 正试图推送到错误的目标 ip 地址(这是一个旧的 vps 地址。我不再拥有它了。)我摆脱了 VPS 但保存了 public 和私钥并将公钥上传到我的新 vps 的新 IP 地址
问题是我不确定旧的目标地址在哪里设置。这是 git 问题吗?如何重定向结构以推送到@roles('production')
当我查看我的 .ssh/known_hosts 时,我看到 198.91.88.101。所以我想知道这是否以某种方式涉及。
它在git 远程配置中。用 git remote --verbose
.
验证
我正在使用 win7 并尝试使用 fabric 将更改推送到 ubuntu 16.04 VPS。到目前为止我有:
env.roledefs = {
'test': ['localhost'],
'dev': ['user@dev.example.com'],
'production': ['deploy@xxx.xx.xx.xx']
}
@roles('production')
def dir():
env.key_filename = '~/.ssh/id_rsa'
local("pip freeze > requirements.txt")
local("git add . --all && git commit -m 'fab'")
local("git push myproject master")
run('pwd')
...
当我运行这个输出是:
$ fab dir
[deploy@xx.xx.xx.xx] Executing task 'dir'
[localhost] local: pip freeze > requirements.txt
[localhost] local: git add . --all && git commit -m 'fab'
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
[master warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
256de92] 'fab'
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.
3 files changed, 10 insertions(+), 9 deletions(-)
[localhost] local: git push example master
debug1: Connecting to 198.91.88.101 [198.91.88.101] port 22.
debug1: connect to address 198.91.88.101 port 22: Connection refused
ssh: connect to host 198.91.88.101 port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Fatal error: local() encountered an error (return code 128) while executing 'git push example master'
所以 fabric 正试图推送到错误的目标 ip 地址(这是一个旧的 vps 地址。我不再拥有它了。)我摆脱了 VPS 但保存了 public 和私钥并将公钥上传到我的新 vps 的新 IP 地址
问题是我不确定旧的目标地址在哪里设置。这是 git 问题吗?如何重定向结构以推送到@roles('production')
当我查看我的 .ssh/known_hosts 时,我看到 198.91.88.101。所以我想知道这是否以某种方式涉及。
它在git 远程配置中。用 git remote --verbose
.