Files
xet-core/git_xet
Assaf Vayner 86935b4117 Move test-only deps to dev-dependencies in git_xet (#767)
## Summary
- Move `russh`, `rand_core`, and `tempfile` from regular dependencies to
dev-dependencies in `git_xet`, since they are only used in test code
- `russh` and `rand_core` are also declared as optional regular deps
activated by the `git-xet-for-integration-test` feature flag, since the
integration test SSH server is compiled into the library under that
feature
- Gate `test_utils/ssh_server` module and related exports behind
`#[cfg(any(test, feature = "git-xet-for-integration-test"))]`
- Gate `tests/test_ssh.rs` integration test file behind `#![cfg(feature
= "git-xet-for-integration-test")]`

## Test plan
- [x] `cargo check -p git_xet` passes (no features)
- [x] `cargo test -p git_xet --no-run` passes (no features)
- [x] `cargo test -p git_xet --features git-xet-for-integration-test
--no-run` passes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: primarily Cargo dependency/feature and `cfg` gating changes,
with no production logic changes; risk is limited to build/test
configuration and feature-flagged integration test coverage.
> 
> **Overview**
> **Reduces default build dependencies for `git_xet`.** Moves `russh`,
`rand_core`, and `tempfile` into `dev-dependencies`, and keeps
`russh`/`rand_core` available as *optional* deps enabled only by the
`git-xet-for-integration-test` feature.
> 
> **Gates SSH test helpers and integration tests behind a feature
flag.** Exposes `GitLFSAuthenticateResponse*` and the local SSH test
server only under `#[cfg(test)]` or `feature =
"git-xet-for-integration-test"`, and makes `tests/test_ssh.rs` compile
only when that feature is enabled.
> 
> Separately, cleans up workspace manifests/lockfiles by moving some
crates (`half`, `regex`, `futures-util`) to dev-deps where they’re only
needed for tests/benches, and adds `.worktrees/` to `.gitignore`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
cdc30a5a8f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-03-31 13:31:20 -07:00
..
2026-02-12 16:40:40 -08:00

Git-Xet is a Git LFS custom transfer agent that implements upload and download of files using the Xet protocol. Install git-xet, follow your regular workflow to git lfs track ... & git add ... & git commit ... & git push, and your files are uploaded to Hugging Face repos using the Xet protocol. Enjoy the dedupe!

Installation

Prerequisite

Make sure you have git and git-lfs installed and configured correctly.

macOS or Linux (amd64 or aarch64)

To install using Homebrew:

brew install git-xet
git xet install

Or, using an installation script, run the following in your terminal (requires curl and unzip):

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/huggingface/xet-core/refs/heads/main/git_xet/install.sh | sh

To verify the installation, run:

git xet --version

Windows (amd64)

Using winget:

winget install git-xet

Using an installer:

  • Download git-xet-windows-installer-x86_64.zip (available here) and unzip.
  • Run the msi installer file and follow the prompts.

Manual installation:

  • Download git-xet-windows-x86_64.zip (available here) and unzip.
  • Place the extracted git-xet.exe under a PATH directory.
  • Run git-xet install in a terminal.

To verify the installation, run:

git xet --version

Uninstall

macOS or Linux

Using Homebrew:

git xet uninstall
brew uninstall git-xet

If you used the installation script (for MacOS or Linux), run the following in your terminal:

git xet uninstall
sudo rm $(which git-xet)

Windows

If you used winget:

winget uninstall git-xet

If you used the installer:

  • Navigate to Settings -> Apps -> Installed apps
  • Find "Git-Xet".
  • Select the "Uninstall" option available in the context menu.

If you manually installed:

  • Run git xet uninstall in a terminal.
  • Delete the git-xet.exe file from the location where it was originally placed.

How It Works

Git-Xet works by registering itself as a custom transfer agent to Git LFS by name "xet". On git push, git fetch or git pull, git-lfs negotiates with the remote server to determine the transfer agent to use. During this process, git-lfs sends to the server all locally registered agent names in the Batch API request, and the server replies with exactly one agent name in the response. Should "xet" be picked, git-lfs delegates the uploading or downloading operation to git-xet through a sequential protocol.

For more details, see the Git LFS Batch API and Custom Transfer Agent documentation.