I've SourceTree setup to use system Git and using Git together with some repositories hosted on Visual Studio Team Service. This worked fine in 2.9.2. If I update to 2.9.4 SourceTree starts to prompt again for credentials. Credential manager is correctly set in the Git configuration and also working fine if I use git directly.
@pascalberger what is the URI of your host?
I ask because there's a bug in v1.6.0 related to URI parsing.
@whoisj It's with Visual Studio Team Service. So something like https://mytenant.visualstudio.com/MYTENANT/_git/MyRepo.
MyRepo contains dots (eg. App.MyApp)
@pascalberger thanks! I'll make sure that gets into the new set of unit tests and works as advertised.
In theory #281, #282, and/or #280 should resolve this issue.
@whoisj I tried to update to Git for Windows 2.10.0 which bundles GCM 1.6.1, but still get a credential prompt while trying to push from SourceTree to GitHub or Visual Studio Team Services.
@pascalberger are you getting the branded credential prompts or the default basic credential prompt (which looks like a Windows dialog)?
@whoisj The branded one:

@pascalberger oh that's the proprietary SourceTree dialog.
The GitHub dialog should looks like this:

The VSTS dialog should look something like this:

This tells me that either SourceTree is getting in the way, or using it's own installation of Git (which isn't setup to use the GCM).
@whoisj I wouldn't expect GitHub or VSTS credential prompt, since GCM has credentials stored which are working fine, without any prompts, from terminal.
SourceTree is setup to use system Git:

If I uninstall Git and reinstall 2.9.2, SourceTree uses GCM again. Therefore I assume this is an issue between SourceTree and GCM, but triggered by recent changes in GCM, since Git 2.9.2 / SourceTree 1.9.6.1 works fine, while Git 2.9.4 / SourceTree 1.9.6.1 won't.
Hmm...
Please try the following setx GIT_TRACE %USERPROFILE%\gitlog.txt then re-run your scenario.
After you're done, try looking in your user-profile directory (%USERPROFILE%) for a file named gitlog.txt and then inside that file look for the keyword "credential". Can you forward those related lines to this thread?
Thanks!
These are the credential entries in the log:
08:18:22.527910 run-command.c:336 trace: run_command: 'git credential-manager get'
08:18:22.552976 git.c:564 trace: exec: 'git-credential-manager' 'get'
08:18:22.552976 run-command.c:336 trace: run_command: 'git-credential-manager' 'get'
08:18:22.633190 run-command.c:336 trace: run_command: 'C:\Program Files (x86)\Atlassian \SourceTree\tools\Askpass.exe' 'Username for '\''https://github.com'\'':
ok so it does call git credential-manager get but then falls back to the value of GIT_ASKPASS. Interesting.
I think I need to install source-tree.
I think I need to install source-tree.
@whoisj Sorry about that :innocent:
I can still observe this behaviour as well with the latest versions of git/gcm/sourcetree and gitlab as the server. Though it appears to only manifest in lfs operations such as checking out a branch, resulting in the failure of the smudge filter due to "No available credentials".
Using git 2.9.2 seems to work fine, as well as removing stored credentials in sourcetree, which enables branch checkouts but makes sourcetree prompt for credentials on other operations such as a simple fetch.
Terminal also works fine as well.
We just had this with a dev in the office, I can confirm going back to 2.9.2 git version solved the issue for us, for anyone else who needs a work around.
@whoisj Were you able to reproduce this issue?
@whoisj Were you able to reproduce this issue?
I wasn't, mostly because I do not have an Atlassian account :smirk: and honestly do not want one.
Guess I'll have to bite the bullet and get one :bomb:
OK installed SourceTree 馃尦 and the fix was simple. It seems SourceTree injects environmental variables into the Git for Windows process, they do so with the "wrong" casing. This was causing confusion and 'causing the GCM to crash during hash table population.
I've changed the logic to allow for duplicate values to override each other (last one in wins! 馃弳 ).
Most helpful comment
OK installed SourceTree 馃尦 and the fix was simple. It seems SourceTree injects environmental variables into the Git for Windows process, they do so with the "wrong" casing. This was causing confusion and 'causing the GCM to crash during hash table population.
I've changed the logic to allow for duplicate values to override each other (last one in wins! 馃弳 ).