我查了很多帖子,但沒有任何幫助。git推顯示錯誤的用戶名
有一個遠程回購是這樣的:https://github.com/cakes/blue.git
全球gitconfig
是:
$ cat ~/.gitconfig
[user]
name = blake.shaw
[http]
sslCaInfo = C:/bin/certificate.crt
這需要一個證書,因此把它作爲http.sslCaInfo
和證書已被添加到git的bin文件夾作爲好。
克隆後,遠程源URL設置爲一樣的東西:[email protected]:cakes/blue.git
的id_rsa和id_rsa.pub也創建。 id_rsa.pub已被添加到github(遠程)中的ssh密鑰中。
當我嘗試做一個git push origin master
,它拋出一個錯誤:
ERROR: Permission to cakes/blue.git denied to blake-shaw
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
這裏有兩個問題:
在URL中的用戶名說
blake-shaw
,而不是blake.shaw
。如何重置它?使用url作爲嘗試:
https://github.com/cakes/blue.git
和使用源代碼樹,試圖推動,但隨後拋出下面的錯誤:remote: Permission to cakes/blue.git denied to blake.shaw. fatal: unable to access 'https://github.com/cakes/blue.git/': The requested URL returned error: 403
感謝@VonC!第二個實際工作。我分叉回購並創建了一個拉請求。關於第一個問題,我已將id_rsa註冊到blake.shaw的帳戶,但後來我想我試圖推到一個回購商店,因爲我不是店主 – allout