Search code examples
bitbucketperforcegit-lfsbfg-repo-cleaner

How to migrate existing Git-p4 repo to LFS


For this moment I have a Git repo that synced to the main p4 depot and works fine. But its size is far more than 4Gb. And we need to move it to BitBucket, where 2Gb is the maximum limit. What I want to achieve:

  1. Put 1 folder and 1 file extension under LFS.
  2. Migrate repo to the BitBucket.
  3. Make it sync both ways with p4 depot.

Assumption for point 1 is to use BFG Repo cleaner. Is it suitable for folders?
Is it possible to achieve point 3?


Solution

  • Assumption for point 1 is to use BFG Repo cleaner.

    According to recent edits to the Git LFS wiki, BFG is not currently the preferred tool for this migration, you want bozaro:git-lfs-migrate. That is likely due to limitations in the BFG support for this migration, which include multi-glob support etc.

    Is it suitable for folders?

    Yes but perhaps not in the way you hope, hence git-lfs-migrate. BFG cannot process qualified/absolute paths, only paths by relative-name.

    Make it sync both ways with p4 depot.

    I think so, see https://developer.atlassian.com/blog/2015/01/work-with-git-and-perforce/ .