Bitbucket Server 4.3+ LFS Storage Question

Bitbucket Server 4.3+ LFS Storage Question

It is awesome that Bitbucket Server 4.3 and above now have LFS as an option. I am unclear where the actual binary files will be living. Is there a secondary directory storage location, the docs completely skip over this.

Running my own Bitbucket Server would keep me from having to go and make use of GitHub to get LFS support rolling for my project, so I am hoping someone may know the answer to this question.

2 answers

This widget could not be displayed.
Jeff Thomas Atlassian Team Jan 25, 2016

Hi Chris,

All of the Git LFS content is stored under $BITBUCKET_HOME/shared/data/git-lfs/storage

This widget could not be displayed.

Hey Jeff,

I found the directory but there are no Files inside it. I pushed some .psd files into my Bitbucket lfs git now.  The lfs storage is still empty. I checked the tracked file extensions with git-lfs track .... I called this inside the repository directory (clientside). Still cant see what im doing wrong.

Jeff Thomas Atlassian Team Feb 01, 2016

Hi Christian,

When you pushed to the repository, did you see a message from Git LFS indicating that the file(s) were being uploaded? You should see something like:

Git LFS: (1 of 1 files) 22.08 MB / 22.08 MB

In the push.

As a quick test, if you modify one of the PSD files, add and commit it, and push again, do you see this message and any data in the storage directory?

Hey Jeff,

no.... nothing about lfs. its only says this:

Pushing to http://cbarghorn@localhost:7990/scm/plt/vergleichsrepo.git

POST git-receive-pack (436 bytes)

To http://cbarghorn@localhost:7990/scm/plt/vergleichsrepo.git

   3155b55..a435c1c  master -> master

updating local tracking ref 'refs/remotes/origin/master'

I added a new psd file for this. The is nothing stored in the lfs directory. I checked the tracked extensions again. its still .psd

Actually i´m thinking about, how lfs knows where to put the .psd data. Does the server manage all this stuff ?

 

Jeff Thomas Atlassian Team Feb 01, 2016

I'm still a bit new to Git LFS, but I think that when a Git push is initiated from the client there are hooks that will detect which files are being tracked by LFS and upload them to the server. There is then an API that the LFS client and server use to manage these files and put them in the correct location.

Since we're not seeing any messages in the push from Git LFS, it seems that it's either not detecting files to upload or the LFS hooks are not firing. 

Have you run git lfs install on your client yet? This just needs to be run once, but could explain why it's not working. 

After making sure that git lfs install has been run, could you run through a similar set of steps to what I've done below? These steps worked for me to get some files uploaded.

  1. Create a new file in the repository named test-lfs.psd
  2. Tell Git LFS to track the file

    git lfs track test-lfs.psd
  3. Add the test-lfs.psd and .gitattributes
    git add .gitattributes test-lfs.psd
  4. Commit our files

    git commit -m "Adding new files to LFS"
  5. Push them to the server

    git push origin master
    
    Git LFS: (1 of 1 files) 7.83 MB / 7.83 MB                                      
    Counting objects: 4, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (4/4), 537 bytes | 0 bytes/s, done.
    Total 4 (delta 1), reused 0 (delta 0)
    To ssh://git@bitbucket.company.com:7999/proj/repo.git
       8dd0d95..3b41ab2  master -> master

Let me know how that goes.

This works fine. Like this i can add single files to the track. So now i have to figure out how i do this for file extension, and then how i convert a whole existing repository to lfs. So far i want to thank you for your help. I appreciate this alot. 

Okay. i just had a look at my .gitattributes file. The extension ".psd" is writen there in the same style as test-lfs.psd ...:

.psd filter=lfs diff=lfs merge=lfs -text
test-lfs.psd filter=lfs diff=lfs merge=lfs -text

I will try to get this t work. I will tell you how that goes smile thank you !

okay. I figured out that my .gitattributes needs: 

*.psd filter=lfs diff=lfs merge=lfs -text

instead of

.psd filter=lfs diff=lfs merge=lfs -text

only with the * it matches ALL psd files. 

 

I am sorry bout posting so many small steps, but i want to keep this up to date for everyone who´s running into the same problems.

@Jeff Thomas ? Do you have any knowledge about this ?

Its about converting an existing Git repository to the git LFS format. I tried it with the step by step guide, but could not make it work at all.  

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
Posted Friday in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

206 views 14 2
Join discussion

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