Import from Git
Want to start a new Xet repository from an existing Git repo? Start here to migrate your code.
Create a new Xet repository
Begin by initializing a new empty Xet repository from the XetHub UI and cloning it to your local machine.
Navigate to your newly cloned Xet repository and make sure that you're on the main
branch:
cd <new-xet-repo>
git checkout main
Migrate code from a Git repository
Existing Git code repositories can be migrated to XetHub while preserving Git history.
From your new Xet repository's directory, add your existing Git repository as a remote named
existing
:git remote add existing <Existing repository's Git URL>
Fetch all branches and commits from
existing
locally.git fetch existing
Rebase against
existing/main
. This will replay allexisting/main
commits on the localmain
branch and then apply allmain
commits (if any) on top.git rebase existing/main
Verify that Git history has been preserved:
git log
Now that the code and Git history are migrated, remove the
existing
remote:git remote remove existing
(Optional) Reorganize directory structure, if needed, to support the co-location of code and assets.
Force push the
main
branch to the XetHub remote. The--force
is necessary because history was re-written with the rebase command.git push --force origin
Your existing Git repository code has now been successfully migrated into a Xet repository!
Used to storing your data separately in S3 or another object store? Follow our docs to move your data into this repository!