File size: 1,193 Bytes
3e42629
8439ac5
3e42629
 
 
 
 
 
 
 
 
 
 
 
 
aa77f96
 
 
3e42629
aa77f96
3e42629
aa77f96
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Adding to Huggingface

1. Check Current status -> git remote -v
2. To remove an exisitng HF Repo -> git remote remove hf
3. To add Files to HF Repo -> git remote add hf https://huggingface.co/spaces/Username/SpaceName
4. Then commit using -> git push hf main OR git push hf main --force

#### Not permitting to add files to HF, generate new token with write permission

1. Go to https://huggingface.co/settings/tokens
2. Click **New token**
3. Name it something like: hf-cli
4. Set **Role = Write**
5. Copy the generated token.
6. logout and login in hf,
        - huggingface-cli logout (deprecated) / hf auth logout
        - huggingface-cli login (deprecated) / hf auth login
        - paste key + enter / $env:HF_TOKEN = "token-no"
7. confirm identity
        - huggingface-cli whoami (deprecated)/ hf auth whoami
8. try to push again
        - git push hf main --force      


git remote set-url origin https://<YOUR_USERNAME>:<YOUR_TOKEN>@huggingface.co/spaces/<YOUR_USERNAME>/<YOUR_REPO>.git

To check root folder in Repo ->  git rev-parse --show-toplevel

To fetch remote branches -> git fetch hf
To check remote branches -> git branch -r
Switch to main branch -> git checkout main