How to get LFS to use saved project credentials?

Ally August 8, 2016

Hi there, I recently updated our repro to use LFS. Our team has pulled latest then been promoted in Source Tree to install the relevant LFS extensions. Then when relaunching source tree they are prompted to run "git lfs pull" as "it does not appear the binary content has been downloaded yet". When clicking Yes to download, after a few seconds, some of our team members are getting the following error: 

 

git -c diff.mnemonicprefix=false -c core.quotepath=false lfs pull


Git credentials for https://MyName@MyProject.git not found.
Git credentials for https://MyName@MyProject.git not found.

Git LFS: (0 of 63 files) 0 B / 1.08 GB


Completed with errors, see above.


Running git 2.81 with git lfs 1.2.0 in Source Tree 1.9.6.0

Everyone has saved credentials in sourcetree and can log into their bitbucket accounts without issue. I have no idea how to fix this and much Googling has not helped us much either. We're game devs and this is our first git project. 

Any help would be great. 

 

4 answers

2 votes
Rodney
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 8, 2016

Hello,

It seems SourceTree's git-lfs UI doesn't use the authentication information in options.

Open a Terminal for the repo and do "git lfs pull".  This should bring up a dialog box asking for a password.  (Mine did this twice).

password_dialog.png

Enter your password, if you are using two-factor authentication make sure to use your "App password".

It should start downloading the files and would work from the command line or the GUI.  If your password doesn't seem to be getting saved you'll need to enable caching by executing 'git config --global credential.helper wincred' from the terminal.  This stores your password in "Credential Manager" that command line git can use.

Do a search for "Credential Manager" in the Start Menu if you want to remove it.

Max Pixel December 13, 2016

Even though I do have xxx@ in my remote URL, this does not work for me. The only solution was to git pull from mingw instead of through the UI (which required entering the password for every single lfs download).

0 votes
guinzoo March 13, 2018

I found some workaround, just go to Options -> Git, and hit Use Embedded Git.

0 votes
Alex Goldberg February 6, 2017

I hit this issue as well.  After some trial-and-error, I realized this was due to the fact that I had multiple Bitbucket accounts configured in SourceTree.  Even though "Account A" was my default, the error message was showing "Account B" as the username.  

This was resolved when I removed "Account B" from SourceTree (File -> Clone/New... -> <Globe button> -> Edit Accounts...).

Oddly, both accounts had read/write access to my repository. 

0 votes
Ally August 8, 2016

Hi, thanks for the reply. Sadly the lfs pull command would not prompt for password. We also tried caching the credentials first as well which also did not work. Again, normal pull worked fine. This seems like a bug that it works for normal pull but not lfs, no? 

 

ST_001.png

 

We're a bit reluctant to go down the road of having a credtail manner, it seems like ti would complicate an otherwise fairly simple setup. Trying to look for more workarounds now.

Rodney
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 8, 2016

I added a screenshot to my answer below that shows the password dialog box.

I was able to reproduce your problem of the dialog box not showing.  It involved cloning the repo but without providing a username like:

https://bitbucket.org/company/repos.git

So I suggest you re-clone using

https://username@bitbucket.org/company/repos.git

Editing the config file's lfs entry won't work because somehow SourceTree thinks it has to add it for you and you'll see multiple entries.

Unfortunately you'll still see your original problem but if you follow my answer it would get fixed.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events