Forums

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

Merging LFS files from fork back to main repository

Iris Seidinger _Reflekt_ May 11, 2020

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

0 votes
Answer accepted
Iris Seidinger _Reflekt_ May 12, 2020

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
AUG Leaders

Atlassian Community Events