0

I have repo project-a which has LFS objects and I need to merge it into project-b. I am following below steps but getting error while performing merge step "git merge --allow-unrelated-histories project-a/main"

Steps:

cd path/to/project-a
git filter-repo --to-subdirectory-filter project-a
cd path/to/project-b
git remote add project-a /path/to/project-a
git fetch project-a --no-tags
git fetch project-a --tags
**git merge --allow-unrelated-histories project-a/main** 
git remote remove project-a

Error:

Error downloading object: Object does not exist on the server: [404] Object does not exist on the serverErrors error: external filter '/bin/git-lfs filter-process' failed fatal: : smudge filter lfs failed

I tried to follow How do you merge two Git repositories? but it doesn't talk about LFS repos.

Toral
  • 551
  • 1
  • 5
  • 13
  • Considering how LFS objects are stored — in a repo-specific remote storage — I don't think it's possible to do directly. IMO the second repository — the one being merged into the current — should be un-LFS-ified (using [`git lfs migrate export`](https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-migrate.adoc#modes) for all branches that will be merged), merged into the current and the combined repo LFS-ified again using `git lfs migrate import`. – phd Apr 18 '23 at 23:46

0 Answers0