# Cant push my model using git

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-my-model-using-git%2F64639%3E%5C
**Category:** Beginners\
**Created:** [December 5, 2023, 10:37am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-my-model-using-git%2F64639 "2023-12-05T10:37:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev-gaju](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/dev-gaju/32/21852_2.png) [@dev-gaju](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdev-gaju)%5C
**Post date:** [December 5, 2023, 10:37am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-my-model-using-git%2F64639%2F1 "2023-12-05T10:37:34Z")

</div>

**When I try to push it shows me that error**  
Enumerating objects: 4, done.  
Counting objects: 100% (4/4), done.  
Delta compression using up to 8 threads  
Compressing objects: 100% (3/3), done.  
Writing objects: 100% (3/3), 3.89 KiB | 3.89 MiB/s, done.  
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0

remote: -------------------------------------------------------------------------  
remote: You are not authorized to push to this repo.  
remote: Make sure that you are properly logged in.  
remote: -------------------------------------------------------------------------

To [https://huggingface.co/dev-gaju/Squad-DistilBert](https://huggingface.co/dev-gaju/Squad-DistilBert)  
! [remote rejected] main → main (pre-receive hook declined)  
error: failed to push some refs to ‘[https://huggingface.co/dev-gaju/Squad-DistilBert](https://huggingface.co/dev-gaju/Squad-DistilBert)’

hugging face env:  
Copy-and-paste the text below in your GitHub issue.

`- huggingface\_hub version: 0.18.0

- Platform: Windows-10-10.0.22621-SP0
- Python version: 3.9.13
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: C:\Users\gazur.cache\huggingface\token
- Has saved token ?: True
- Who am I ?: dev-gaju
- Configured git credential helpers: manager, store
- FastAI: N/A
- Tensorflow: N/A
- Torch: 2.1.0
- Jinja2: 3.1.2
- Graphviz: N/A
- Pydot: N/A
- Pillow: 10.0.1
- hf\_transfer: N/A
- gradio: N/A
- tensorboard: N/A
- numpy: 1.26.1
- pydantic: 2.5.2
- aiohttp: 3.9.1
- HUGGINGFACE\_HUB\_CACHE: C:\Users\gazur.cache\huggingface\hub
- HUGGINGFACE\_ASSETS\_CACHE: C:\Users\gazur.cache\huggingface\assets
- HF\_TOKEN\_PATH: C:\Users\gazur.cache\huggingface\token
- HF\_HUB\_OFFLINE: False
- HF\_HUB\_DISABLE\_TELEMETRY: False
- HF\_HUB\_DISABLE\_PROGRESS\_BARS: None
- HF\_HUB\_DISABLE\_SYMLINKS\_WARNING: False
- HF\_HUB\_DISABLE\_EXPERIMENTAL\_WARNING: False
- HF\_HUB\_DISABLE\_IMPLICIT\_TOKEN: False
- HF\_HUB\_ENABLE\_HF\_TRANSFER: False`

---

<div class="post-metadata">

**Author:** ![mapama247](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mapama247/32/33424_2.png) [@mapama247](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmapama247)%5C
**Post date:** [December 5, 2023, 3:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-my-model-using-git%2F64639%2F2 "2023-12-05T15:54:51Z")

</div>

Looks like it is a private repository (at least I can’t open the link), did you log in with your access token? You should probably use the [huggingface-cli login](https://huggingface.co/docs/huggingface_hub/quick-start#login) command beforehand.

---

<div class="post-metadata">

**Author:** ![dev-gaju](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/dev-gaju/32/21852_2.png) [@dev-gaju](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdev-gaju)%5C
**Post date:** [December 6, 2023, 12:46am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-my-model-using-git%2F64639%2F3 "2023-12-06T00:46:54Z")

</div>

Yes, I used my access token to log in, Should I use my access token before every push? Manually adding to the repository works for me but not with the command line.

---

<div class="post-metadata">

**Author:** ![mapama247](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mapama247/32/33424_2.png) [@mapama247](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmapama247)%5C
**Post date:** [December 7, 2023, 12:13pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-my-model-using-git%2F64639%2F4 "2023-12-07T12:13:27Z")

</div>

No no, logging in once should be enough, I just thought this might be the cause because of the “not authorized” error. Maybe [this other thread](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-to-new-space%2F35319) helps, you can also try with SSH authentication as one of the users suggests.

---

<div class="post-metadata">

**Author:** ![LeoClose](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@LeoClose](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLeoClose)%5C
**Post date:** [February 4, 2024, 3:25pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-push-my-model-using-git%2F64639%2F5 "2024-02-04T15:25:37Z")

</div>

If anyone else is having problems with pushing to your repo, be sure to set your API Key to “write”. A little thing that you may not think about while committing…
