Skip to main content

Importing from Git LFS

Moving your files from a Git LFS-enabled repository into XetHub allows you to leverage Xet-specific features like mount, block-level deduplication, and custom visualization.

Create a new repository

Skip this section if you already have a repository that you'd like to migrate files into.

Using the (+) dropdown on the top right of the XetHub UI, create a new repository and clone it to your local machine. Navigate to the directory and make sure that you're on the main branch:

cd <repository-name>
git checkout main

Import a snapshot of an existing Git LFS repository

note

This import path copies a snapshot of your current Git LFS repository into XetHub without affecting the original repository. While XetHub will track the evolution of your repository going forward, you will need to use Git LFS in the original repository to access history or other branches.

  1. Ensure that you have an up-to-date local copy of your existing Git LFS repository.

    a. If you don't have a local copy, clone the repository into a directory called LFSRepo. (Assumes Git LFS is already installed.)

    git clone <Existing Git LFS repository's Git URL> LFSRepo

    b. If already have the repository locally, navigate to it and pull to make sure you have the latest changes.

    cd <LFS Repository>
    git pull
    cd ..
  2. Copy over all the files from the existing repository into the new Xet repository.

    rsync -av --exclude='.git/' --exclude='.gitattributes' <LFS Repository> <new-xet-repo>
  3. Navigate to your new Xet repository to add and commit the Git LFS snapshot.

    cd <new-xet-repo>
    git add ./ && git commit

This will create a commit containing everything from your existing Git LFS repository. A snapshot of existing Git LFS repository has now been successfully been imported to XetHub! The Git-Xet extension will automatically pick up all new files, deduplicate all the data, and manage changes going forward.