How to get LFS to use saved project credentials?

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

This widget could not be displayed.

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.

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).

This widget could not be displayed.

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.

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.

 

This widget could not be displayed.

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. 

This widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

721 views 1 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you