Takosaga commited on
Commit
0c86408
Β·
1 Parent(s): e8a0fdb

docs: add gotcha about hf.co vs huggingface.co for git ops

Browse files
Files changed (1) hide show
  1. AGENTS.md +19 -0
AGENTS.md CHANGED
@@ -426,3 +426,22 @@ ValueError: A function didn't return enough output values (needed: N, returned:
426
  ```
427
 
428
  This applies to all generator click/change handlers in `frontend/ui/widgets.py:build_ui()`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  ```
427
 
428
  This applies to all generator click/change handlers in `frontend/ui/widgets.py:build_ui()`.
429
+
430
+ ### 13. Hugging Face git hostname is `hf.co`, not `huggingface.co`
431
+
432
+ For **git operations** (push/pull/fetch) with Hugging Face Spaces, use `git@hf.co:user/repo.git` β€” **not** `git@huggingface.co:user/repo.git`. The two hostnames resolve differently:
433
+ - `hf.co` β†’ correct git SSH endpoint (returns `Hi <user>, welcome to Hugging Face.`)
434
+ - `huggingface.co` β†’ web frontend; SSH connection times out or returns `Host key verification failed`
435
+
436
+ The **web URL** still uses `huggingface.co/spaces/...`. Never mix the two:
437
+
438
+ ```bash
439
+ # βœ… Correct β€” git operations use hf.co
440
+ git remote set-url hf git@hf.co:build-small-hackathon/EuropaLex.git
441
+ git push hf main
442
+
443
+ # ❌ Wrong β€” huggingface.co for git hangs/times out
444
+ git remote set-url hf git@huggingface.co:build-small-hackathon/EuropaLex.git
445
+ ```
446
+
447
+ For **HTTPS** pushes, use `https://<TOKEN>@huggingface.co/...` (the web hostname is fine for token-based auth). For **SSH**, always use `hf.co`. Binary files (test outputs like `.wav`, `.png`) are rejected by HF's git hook β€” exclude them in `.gitignore` and run `git filter-branch` on existing history if they were already committed.