The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How does BitBucket handle Pull Requests for updates to LFS Blobs

Phillip Demro
February 18, 2021

Thanks for looking.  I am wondering how BitBucket handles the scenario below:

 

  1. Repository "A" has a Git-LFS blob, "blob a"
  2. Alice Forks Repository A
  3. Alice makes an update to "blob a" and pushes
  4. Alice opens a PR to Repository A
  5. PR is merged into Repository A

 

In this scenario, would the LFS blob be automatically updated in repository A?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Phillip Demro
February 18, 2021

Copy pasted from SO:

 

This is a known issue, see current limitations for Git LFS with Bitbucket. I also hope Bitbucket (and Github!) is going to improve this.

Consequences:

  • LFS files must be synced between the fork and the upstream repo manually
  • Forks will also use significant Large File Storage space, not just the upstream (there is a free storage quota - but after that is exhausted you will have to pay for each fork, ouch!)
  • To copy LFS files back from the fork to the upstream, you will either need write access to the upstream repo or the upstream owner has to do it himself

How to sync the LFS files:

  1. Cloning the fork repo for the very first time - it does not have any LFS files copied yet, so you must clone it without the LFS files (otherwise cloning would fail)
export GIT_LFS_SKIP_SMUDGE=y
git clone <address of your fork>
  1. Synchronizing upstream -> fork (copying LFS files to your fork) - initially and each time you git fetch the upstream
git lfs fetch --all <upstream>
git lfs push --all <fork>
  1. Synchronizing fork -> upstream (only the current branch) - each time after your PR got merged
git lfs fetch <fork>
git lfs push <upstream>

If there is a better workflow than this, please let me know. This is a serious limitation of the Bitbucket LFS handling.

 

https://stackoverflow.com/questions/55359067/what-is-the-workflow-for-git-lfs-with-forks