{"action":"created","issue":{"url":"https://api.github.com/repos/git/git-scm.com/issues/810","repository_url":"https://api.github.com/repos/git/git-scm.com","labels_url":"https://api.github.com/repos/git/git-scm.com/issues/810/labels{/name}","comments_url":"https://api.github.com/repos/git/git-scm.com/issues/810/comments","events_url":"https://api.github.com/repos/git/git-scm.com/issues/810/events","html_url":"https://github.com/git/git-scm.com/issues/810","id":167088723,"number":810,"title":"git push http[s] uses wrong username","user":{"login":"hohwille","id":1923119,"avatar_url":"https://avatars.githubusercontent.com/u/1923119?v=3","gravatar_id":"","url":"https://api.github.com/users/hohwille","html_url":"https://github.com/hohwille","followers_url":"https://api.github.com/users/hohwille/followers","following_url":"https://api.github.com/users/hohwille/following{/other_user}","gists_url":"https://api.github.com/users/hohwille/gists{/gist_id}","starred_url":"https://api.github.com/users/hohwille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hohwille/subscriptions","organizations_url":"https://api.github.com/users/hohwille/orgs","repos_url":"https://api.github.com/users/hohwille/repos","events_url":"https://api.github.com/users/hohwille/events{/privacy}","received_events_url":"https://api.github.com/users/hohwille/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-22T17:00:41Z","updated_at":"2016-07-31T15:38:58Z","closed_at":"2016-07-22T18:53:39Z","body":"If you have multiple accounts for the same host (say github.com) there seems to be no way to tell git which user to use when pushing a repository.\r\nSome time ago I was able to workaround this limitation by using different credential helpers and switching in `.gitconfig` but with the recent version of git client this does not work anymore.\r\nSo I end up in a situation where I want to push but this fails because git automatically chooses the (wrong) account (username and password) and the server then rejects the push due to missing permissions. I can not find any way to tell git to ask me for a username or to specify another.\r\nI commented out credential helper from `~/.gitconfig`. Also I read on the web about a config `credential.username` but also this seems to have no effect. Also I tried this:\r\nhttps://git-scm.com/docs/git-credential-cache\r\n```\r\n>git credential-cache exit\r\ngit: 'credential-cache' is not a git command. See 'git --help'.\r\n```\r\nVery interesting. New feature added it patch version or documentation bug?\r\n\r\nSeems I either have to switch to SSH or I need a separate machine (VM) for each account what seems absurd.\r\nI would be more than pleased to get any better workaround or solution for this. Thanks in advance.\r\nBTW: I am working on windows with `git version 2.9.0.windows.1`. I will update to 2.9.2 but do not expect anything from that...\r\nAlso I am quite happy that the times are over where I had to enter login and password for each push but if git automagically chooses the wrong user and there is not even a fallback to enter the login manually if authorization failed this is kinda bad."},"comment":{"url":"https://api.github.com/repos/git/git-scm.com/issues/comments/236436811","html_url":"https://github.com/git/git-scm.com/issues/810#issuecomment-236436811","issue_url":"https://api.github.com/repos/git/git-scm.com/issues/810","id":236436811,"user":{"login":"peff","id":45925,"avatar_url":"https://avatars.githubusercontent.com/u/45925?v=3","gravatar_id":"","url":"https://api.github.com/users/peff","html_url":"https://github.com/peff","followers_url":"https://api.github.com/users/peff/followers","following_url":"https://api.github.com/users/peff/following{/other_user}","gists_url":"https://api.github.com/users/peff/gists{/gist_id}","starred_url":"https://api.github.com/users/peff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peff/subscriptions","organizations_url":"https://api.github.com/users/peff/orgs","repos_url":"https://api.github.com/users/peff/repos","events_url":"https://api.github.com/users/peff/events{/privacy}","received_events_url":"https://api.github.com/users/peff/received_events","type":"User","site_admin":true},"created_at":"2016-07-31T15:38:58Z","updated_at":"2016-07-31T15:38:58Z","body":"The `credential-store` bug is [known and fixed](http://public-inbox.org/git/7210bce6-093b-9fdf-9a9b-94059ad0d4e3%40ucar.edu/T/#u), but not yet in any released version of git."}}
{"actor":{"display_login":"peff"}}