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/'
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:-
- 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.
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”
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.
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
- https://developer.github.com/changes/2020-02-14-deprecating-password-auth/
- https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
Feel free to share your thoughts in the comments section below!
4 thoughts on “How to Fix “git-upload-pack not permitted on” error while Git Pull and Push!”
Thanks for the solution. But in my case “Configure fetch from upstream” or the “Configure push to upstream” both are disabled in eclipse. SO how to proceed in this case.
Is your project imported properly? Are you able to pull or fetch? Please try to open the eclipse in admin mode once and see if that helps!
So I can tell you if the token is not correct you definitely will not get the “upload-pack not permitted” error. You will either get repromoted for a password\token or get a completely different error. I’ve tried every solution to this issue and none work.
please paste your error log here, we will look into it.