0
我正在使用win7并尝试使用fabric来将更改推送到Ubuntu 16.04 VPS。到目前为止,我有:Fabric git推送到错误的ip地址
env.roledefs = {
'test': ['localhost'],
'dev': ['[email protected]'],
'production': ['[email protected]']
}
@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
[[email protected]] 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'
所以面料是试图推到了错误的目标IP地址(这是一个古老的VPS地址我不再。 )我摆脱了VPS,但保存了公钥和私钥,并将pub密钥上传到新的ip地址的新vps
问题是我不确定旧的目标地址在哪里组。这是一个混帐问题。我如何重定向面料推到@roles('生产')
当我看我的.ssh/known_hosts我看到198.91.88.101。所以我想知道这是否涉及到某种方式。
$ git remote --verbose 示例ssh://[email protected]/~/example(fetch) 示例ssh://[email protected]/~/example(push) – user61629