Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Merging LFS files from fork back to main repository

Hi there,

we recently started using git LFS and are now having issues with our forks.

The problematic workflow is the following:

1. Someone creates a fork B from our Main Repository A

2. They follow the workaround mentioned here https://confluence.atlassian.com/bitbucket/current-limitations-for-git-lfs-with-bitbucket-828781638.html
in "Git LFS files are not copied when a repo is forked"
to copy over A's LFS content to the fork B.

3. They now create new LFS files and push them to their fork B

4. They open a Pullrequest back from fork B to main repo A

5. The Pullrequest gets merged

Result: On Repository A the LFS files that were coming from B cannot be found. Anyone who now tries to pull will run into a 404 error and the branch has to be resetted to the state before the merge as noone can check the merged state out anymore.

Access rights:
Developers of fork B should only have read-only access to repo A

Developers of repo A should not have write access to fork B.

 

How can we solve our issues of LFS files apparently needing to be cross pushed between the repositories? Is there any way to achieve this?

1 answer

1 accepted

We worked around the issue by having developers of repo A checkout the fork and execute

git lfs push --all originOfRepoA

manually before merging the pullrequest.

However this should be automated. We are not sure yet how to do that easily.

Its quite a risk if it gets forgotten in a Pull Request and merging it then breaks develop, requiring a highly discouraged force rewrite to roll back the changes

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,717 views 10 16
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you