2014-10-31 44 views
0

儘管我自己的憑據使用了git config --global user.nameuser.email,但運行Yosemite的Mac上的github安裝仍然嘗試將github上一位用戶用於同一臺機器上,以便我推送失敗如下:身份混淆Github Mac OS X

remote: Permission to MyRepository denied to OtherUser 
fatal: unable to access 'https://github.com/MyUserName/MyRepository.git/': The requested URL returned error: 403 

任何幫助表示讚賞。

+0

你在做git config user.name「myNameHere」嗎?也許甚至嘗試手動進行。 vi〜/ .gitconfig – Doctor06 2014-10-31 19:24:46

+0

謝謝。但是,罪魁禍首簡直就是存儲在OSX Keychain中的密碼! – BeMuSeD 2014-11-01 10:27:16

回答

0

您可以在您的本地項目的.git文件夾的配置中覆蓋全局設置。例如,我使用:

[core] 
    ... core stuff ... 
[remote "*someRepos*"] 
    url = ssh://*someuser*@*somedomain.com*/*gitServerGitDirectory*/*someRepos*/*someProject* 
    fetch = +refs/heads/*:refs/remotes/*someRepos*/* 
[branch "master"] 
    remote = *someRepos* 
    merge = refs/heads/master 

其中SomeUser的重寫我的本地機器的全局設置。