身份混淆Github Mac OS X.

时间:2014-10-31 19:19:55

标签: github

尽管我使用git config --global user.nameuser.email作为我自己的凭据,但运行Yosemite的Mac上的github安装仍然试图像以前在同一台机器上使用github的用户一样推送,所以我的推动失败如下:

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

任何帮助表示感谢。

1 个答案:

答案 0 :(得分: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 会覆盖我本地计算机的全局设置。

相关问题