2017-06-14 39 views
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。所以我想知道這是否涉及到某種方式。

回答

2

它在git遠程配置中。使用git remote --verbose進行驗證。

+0

$ git remote --verbose 示例ssh://[email protected]/~/example(fetch) 示例ssh://[email protected]/~/example(push) – user61629