2012-12-04 40 views
1

我想用邁克爾·哈特爾的軌道教程(first_app)與git推起源的主人,但我發現了這個問題:推Git的主產地致命錯誤:允許railstutorial/first_app.git否認

[first_app]$git push origin master 
ERROR: Permission to railstutorial/first_app.git denied to tomkim 
fatal: The remote end hung up unexpectedly 

我重新輸入了一個SSH密鑰,但事實並非如此。我以前從來沒有遇到過這個問題,但現在我是。

非常感謝。

+0

你能夠'ssh -v'到服務器嗎? –

+2

你是否試圖推送到Rails教程github帳戶,而不是你自己的? –

回答

4

您需要添加自己的回購作爲遠程(當然你需要首先創建Github上一個first_app回購):

$ git remote rm origin 
$ git remote add origin [email protected]:tomkim/first_app.git 
$ git push -u origin master 

而且tomkim是你的github上的帳戶名,對不對?如果沒有,請將其更改爲您的。

0

我能弄明白這一點。我注意到原來顯示「railstutorial/first_app.git」,當它應該是tomkim310/first_app.git。開始的問題是遵循Hartl的教程,我只是在打字的時候。簡單地做一個新的「git remote add origin [email protected]:tomkim310/first_app.git」並不能解決問題。

我通過鍵入:git remote -v驗證了這一點,它給了origin [email protected]:railstutorial/first_app.git。要改變它,我輸入:git config remote.origin.url [email protected]:tomkim310/first_app.git

然後這樣做,git push origin master工作。

相關問題