2017-08-22 95 views
0

我有點困惑如何到達這一點,但我從我的機器連接到我的服務器,當我做git remote -v指向自己,所以它有時會給出有趣的回購我的服務器警告通知。Git遠程指向自己在服務器上

git remote -v 
origin ssh://[email protected]/var/www/dating.co.uk (fetch) 
origin ssh://[email protected]/var/www/dating.co.uk (push) 

聲明

On branch master 
Your branch is ahead of 'origin/master' by 120 commits. 
    (use "git push" to publish your local commits) 

或者

git push 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

我知道我永遠不會需要推動,但它仍然惹惱我了。

我怎樣才能指向localhost?或類似的東西,所以我不會得到這些錯誤?

+0

用適當的URL調用'git remote'或手工編輯'.git/config'來進行回購。您的遠程實際上可以是一個文件夾。你到底在做什麼? –

+0

當您運行['git remote -v'](https://git-scm.com/docs/git-remote)時,您沒有連接到任何服務器。要檢查這個禁用網絡並運行'git remote -v'。大多數'git remote'子命令顯示的信息(包括帶有或不帶'-v'的空子命令)從本地存儲庫中檢索。其他Git命令('fetch','pull','push'等)使用'git remote'提供的信息來知道在哪裏可以找到遠程倉庫。 'git push'失敗,因爲使用公鑰對遠程倉庫的訪問配置不正確(或根本沒有配置)。 – axiac

回答

相關問題