|
| 1 | +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! |
| 2 | + |
| 3 | +## Installation |
| 4 | +### Prerequisite |
| 5 | +Make sure you have [git](https://git-scm.com/downloads) and [git-lfs](https://git-lfs.com/) installed and configured correctly. |
| 6 | +### macOS or Linux (amd64 or aarch64) |
| 7 | + To install using Homebrew: |
| 8 | + ``` |
| 9 | + brew tap huggingface/tap |
| 10 | + brew install git-xet |
| 11 | + ``` |
| 12 | + Or, using an installation script, run the following in your terminal (requires `curl` and `unzip`): |
| 13 | + ``` |
| 14 | + curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/huggingface/xet-core/refs/heads/main/git_xet/install.sh | sh |
| 15 | + ``` |
| 16 | + To verify the installation, run: |
| 17 | + ``` |
| 18 | + git-xet --version |
| 19 | + ``` |
| 20 | + |
| 21 | +### Windows (amd64) |
| 22 | + Using an installer: |
| 23 | + - Download `git-xet-windows-installer-x86_64.zip` ([available here](https://github.com/huggingface/xet-core/releases/download/git-xet-v0.1.0/git-xet-windows-installer-x86_64.zip)) and unzip. |
| 24 | + - Run the `msi` installer file and follow the prompts. |
| 25 | + |
| 26 | + Manual installation: |
| 27 | + - Download `git-xet-windows-x86_64.zip` ([available here](https://github.com/huggingface/xet-core/releases/download/git-xet-v0.1.0/git-xet-windows-x86_64.zip)) and unzip. |
| 28 | + - Place the extracted `git-xet.exe` under a `PATH` directory. |
| 29 | + - Run `git-xet install` in a terminal. |
| 30 | + |
| 31 | +To verity the installation, run: |
| 32 | + ``` |
| 33 | + git-xet --version |
| 34 | + ``` |
| 35 | + |
| 36 | +## Uninstall |
| 37 | +### macOS or Linux |
| 38 | +Using Homebrew: |
| 39 | + ``` |
| 40 | + git-xet uninstall |
| 41 | + brew uninstall git-xet |
| 42 | + ``` |
| 43 | +If you used the installation script (for MacOS or Linux), run the following in your terminal: |
| 44 | + ``` |
| 45 | + git-xet uninstall |
| 46 | + sudo rm $(which git-xet) |
| 47 | + ``` |
| 48 | +### Windows |
| 49 | +If you used the installer: |
| 50 | +- Navigate to Settings -> Apps -> Installed apps |
| 51 | +- Find "Git-Xet". |
| 52 | +- Select the "Uninstall" option available in the context menu. |
| 53 | + |
| 54 | +If you manually installed: |
| 55 | +- Run `git-xet uninstall` in a terminal. |
| 56 | +- Delete the `git-xet.exe` file from the location where it was originally placed. |
| 57 | + |
| 58 | +## How It Works |
| 59 | +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. |
| 60 | + |
| 61 | +For more details, see the Git LFS [Batch API](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md) and [Custom Transfer Agent](https://github.com/git-lfs/git-lfs/blob/main/docs/custom-transfers.md) documentation. |
0 commit comments