機器甲上曾經使用過一個私人github賬號A,並且添加了ssh驗證
后來為了公共開發,又創建了一個github賬號B,提交的時候發現出現錯誤: remote: Permission to user_B/xxx.git denied to user_A
使用git config, git log 查看用戶名都是賬號B
github上的解決方法(https://help.github.com/articles/error-permission-to-user-repo-denied-to-other-user/)不適合,因為該項目是B創建的,並不屬於A
按照https://help.github.com/articles/generating-ssh-keys/ 方法重新創建,還是一樣的錯誤
最后嘗試將https 換成 git (https://help.github.com/articles/changing-a-remote-s-url/)
git remote set-url origin git@github/...
正確提交
17:09 2015/3/29
問題是多個github賬戶的沖突, 清除所有github賬戶上的 ssh key,按照如下教程重新建立 ssh-key
http://code.tutsplus.com/tutorials/quick-tip-how-to-work-with-github-and-multiple-accounts--net-22574
http://superuser.com/questions/272465/using-multiple-ssh-public-keys
