Authentication Fails when Integrating Bitbucket Server with Github for Windows GUI Client
症状
GitHub for Windows GUI Client is being used to manage Git repositories and then integrate with Bitbucket Server. When attempting to publish a commit, it will ask for authentication showing local server name in the box and requesting a username/password but nothing happens after entering this information. It looks like it is trying to contact Bitbucket Server because it will give a fail message after a few attempts and then Bitbucket Server UI requires to use the captcha option to get back into the user account.
Similar activity is reported in Bitbucket Server logs:
2013-01-24 09:17:40,783 DEBUG [http-7990-6] 557x1793209x2 172.27.5.113 "GET /scm/TQ/data.git/info/refs HTTP/1.1" c.a.s.i.s.CustomSecurityContextPersistenceFilter SecurityContextHolder now cleared, as request processing completed
2013-01-24 09:17:40,908 DEBUG [http-7990-6] 557x1793210x2 172.27.5.113 "GET /scm/TQ/data.git/info/refs HTTP/1.1" c.a.s.internal.user.UserServiceImpl Authenticating user <Username>
2013-01-24 09:17:43,455 DEBUG [http-7990-6] <Username> 557x1793210x2 k4fcng 172.27.5.113 "GET /scm/TQ/data.git/info/refs HTTP/1.1" c.a.s.i.s.CustomSecurityContextPersistenceFilter SecurityContextHolder now cleared, as request processing completed
2013-01-24 09:17:43,533 DEBUG [http-7990-4] chet_watkins 557x1793208x2 19rp0j 10.2.164.104 "GET /admin/logging HTTP/1.1" c.a.s.i.s.CustomSecurityContextPersistenceFilter SecurityContextHolder now cleared, as request processing completed
原因
GitHub's client's cache git usernames/passwords. Unfortunately, GitHub's GUI Client for Windows doesn't seem to handle changed passwords. After showing the "login required" dialog, it doesn't seem to use the new password.
ソリューション
The GitHub for Windows command line client, Git Shell, doesn't have this problem. Open Git Shell, go to your repository and try any server operation (git fetch, for instance). It will ask for your username and password. Once you enter them, the GUI client should work fine (it uses the same username/password cache as the command line client).
Another possible resolution is to open Windows Control Panel > User Accounts > Credential Manager > Windows Credentials, then update the password by editing the credentials for Git under the category "Generic Credentials".