2017-06-14 14 views
0

私はwin7に取り組んでおり、ファブリックを使って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を取り除きましたが、公開鍵と秘密鍵を保存して、新しいIPアドレスで新しいvpsに公開鍵をアップロードしました。

問題は古いターゲットアドレスがどこにあるのかわかりませんセット。これはgitの問題ですか?ファブリックをリダイレクトして@rolesにプッシュする方法( 'production')

私の.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

関連する問題