Skip to main content

Create, Clone, Add

The basic XetHub workflow is one that mirrors the typical Git workflow. Xet repositories are created through the XetHub web UI. Initialize a new empty Xet repository and clone it to start from scratch, or clone an existing Xet repository to build on existing work.

note

Make sure that you have installed the git-xet extension prior to running these steps.

Create a Xet repository

  1. After logging in to XetHub, use the + dropdown in the top right corner of any page to create a new Xet repository.

  2. Add a name and description to your repository, choose its visibility, and click Create Xet repository.

Clone a Xet repository

Cloning Xet repositories should automatically support the tracking of code with large assets. Make sure that you have already installed the git-xet extension.

For a full clone of any XetHub repository, copy the Xet URL and clone from your terminal:

git xet clone <Xet URL> <destination folder>

Working with huge repositories

If you only need to work with a subset of files within a huge repository, you can clone the entire repository without materializing any large files to save disk space and download time. The following command checks out a repository, but keeps all files that are non-UTF-8 decodeable or larger than 256KB as pointer files:

git xet clone --no-smudge <Git remote URL>

Once the repository is cloned, you can individually "smudge" the pointers into full files:

git xet checkout <pointers> 

And "unsmudge" them to return full files to pointers:

touch <files>
XET_NO_SMUDGE=1 git checkout <files>

Add files

Git allows you to choose what files are tracked and how to associate them with any commit. Running git add on a file moves that file to be staged for inclusion in the next commit.

  1. Before staging any files, double check your repository and any changes in it:

    git status
  2. Mark any files you would like to associate with the next commit, explicitly staging them:

    git add <file or path>

    If you are confident about adding all modified files in the repository, you can stage all new, modified, and deleted files that are not listed in .gitignore with:

    git add .
  3. Check the state of the repository again to make sure that the expected files were moved to staging:

    git status
  4. If needed, undo an add by moving all staged changes back out with:

    git reset