How to Fix “git-upload-pack not permitted on” error while Git Pull and Push!

Hi There! 👋

You have landed here probably because you are getting an error something like this – "git-upload-pack not permitted on" in your eclipse or on the git command line for repositories using https:// protocol

Error

https://github.com/<<your github>>/<<your repository>>.git: git-upload-pack not permitted on 'https://github.com/<<your github>>/<<your repository>>.git/'
How to Fix "git-upload-pack not permitted on" error while Git Pull and Push!
How to Fix “git-upload-pack not permitted on” error while Git Pull and Push!

Solution

The good news is – there is a solution to it. But a pre-context – As per a blog post on GitHub, about deprecating password authentication:

GitHub no longer supports basic authentication using a username and password. Instead, we recommend using personal access tokens or the web application flow.

What it means is that the password you are trying to do your git push or git fetch from upstream is not able to recognize the credentials and hence fails.

Simple Solution: You need to create an access token and use that instead of the password that you have been using till now.

Follow the below steps to resolve the issue:

Step 1

Go to your GitHub account and follow the steps mentioned in this GitHub documentation to generate your access token by following steps:-

How to Generate github access tokens
  • In the upper-right corner of GitHub account, click your profile photo, then click Settings.
  • In the left sidebar, click Developer settings.
  • In the left sidebar, under Personal access tokens, click tokens(Classic).
  • Click Generate new token(classic) you can try the fine-grained one but for the current issue, classic is just fine.
  • Under Token name, enter a name for the token. e.g. eclipse ide token
  • Under Expiration, select an expiration for the token.
  • just select the first scope for repo read-write, you can explore other scopes as well as per your need.
  • Scroll down to last and click Generate Token.
Add new personal token classic on github repo

Step 2

Once you have generated the access token and copied it, go to Eclipse. Right-click on the repository you want to pull, clone or push -> go to remote and configure the “Configure fetch from upstream” or the “Configure push to upstream”

How to Fix "git-upload-pack not permitted on" error while Git Pull and Push!
How to Fix “git-upload-pack not permitted on” error while Git Pull and Push!

In the next popup click on the change button and in the next configuration box, enter the newly copied access token in the password field click on finish, and then click on Save and fetch in the main popup.

How to Fix "git-upload-pack not permitted on" error while Git Pull and Push!
How to Fix “git-upload-pack not permitted on” error while Git Pull and Push!

This time it should work. It will simply use the access token to verify your credentials and fetch from the GitHub repository. Alternatively, you can also try to see if the git pull or other git commands work well on git bash.

Further References

Feel free to share your thoughts in the comments section below!

Spread the word!
0Shares

Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “How to Fix “git-upload-pack not permitted on” error while Git Pull and Push!”