Simon Sheehan
Simon Sheehan

Reputation: 765

git-receive-pack not permitted on Push

I am using EGit in Eclipse, and attempting to push to Github. I made a commit locally, and then tried to push it upstream. I got this error:

 Can't connect to any URI: https://github.com/Buroa/Konklex.git (An internal Exception occurred during push: https://github.com/Buroa/Konklex.git: git-receive-pack not permitted)

I can't seem to find a way around it. Am I missing something here?

Upvotes: 30

Views: 125782

Answers (25)

Gaganam Krishna
Gaganam Krishna

Reputation: 151

In my case, I resolved this issue by changing the GitHub token, I regenated the token and given in eclipse. by the way I used the Fine grained token on github.

we need to give the permissions for token users.

enter image description here

Upvotes: 0

Jonathan Benn
Jonathan Benn

Reputation: 3589

git-receive-pack not permitted is equivalent to username/password not recognized

As others have posted, you could get the error message for many different reasons, including:

  • You don't have an account on Github
  • You didn't do the email verification to complete your account on Github
  • Your username does not have push rights to that repository (e.g. your username is not listed as a contributor)
  • You used the wrong username by accident (substituting with one that does not have push rights on that repository)
  • You entered the password wrong
  • You pushed using the wrong protocol (e.g. you used SSH or HTTPS, when only the other protocol was acceptable)
  • You provided the correct authentication but the email address you sent with it did not match what the server was expecting

Upvotes: 8

Lars Hendriks
Lars Hendriks

Reputation: 1058

for people wondering how to fix this for Bitbucket repo + eclipse IDE

go to Preferences->Git and then change Http Client to Java built-in HTTP

This resolved the issue for me.

Upvotes: 1

Ali Shaukat
Ali Shaukat

Reputation: 35

In newer updates of GitHub, applications are not allowed direct access to your account repositories. To overcome this, you have to create a token from "Settings > Developers > Create Token with Repository Rights" and use that instead of your password in eclipse or any other application. This will work. All the answers above are for before the update, so they won't solve the problem.

For a more detailed guide, you can refer to this video (it's not mine): https://www.youtube.com/watch?v=8x0ywtCOzxo

Upvotes: 2

Rahul Sheth
Rahul Sheth

Reputation: 21

Try this

This error is because of the upgrade. So you need to go to

Settings > Developer settings > Personal access tokens > Generate Token

  1. Select the first option & click generate
  2. Use this generated token as password of git

https://www.youtube.com/watch?v=rLEYw1caoBQ

Upvotes: 0

Ali Iqbal
Ali Iqbal

Reputation: 111

I resolved this using PATs(Personal Access Tokens). You can use the combination of PATs with usernames instead of passwords.

Follow this github guideline: https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line.

If you want to use a PAT to access resources owned by an organization that uses SAML SSO, you must authorize the PAT. For more information, see "About authentication with SAML single sign-on" and "Authorizing a personal access token for use with SAML single sign-on."

Upvotes: 3

Sawan Upadhyay
Sawan Upadhyay

Reputation: 1

Stumbled upon this for a long time and finally found the answer. In the Password section, we should not be entering the GitHub login password, instead we have to enter the Personal Access Token. Below link shows how to create the Personal Access Token: https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

Upvotes: 0

Shrutika Sawant
Shrutika Sawant

Reputation: 31

After the latest github update you cannot use password to access. Instead use 2FA or generate a token and place it in password field. Follow the link below.

Generate token

Upvotes: 2

Chandan Gupta
Chandan Gupta

Reputation: 95

With the latest changes in GitHub, try this link. Now instead of actual password you need to pass token as password.

Refer - https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

Upvotes: -1

Vivekraj A P
Vivekraj A P

Reputation: 1

Go to Bitbucket - Personal Settings - Access Management - App Passwords - Click 'Create app password' Button

Provide any name in 'Label' fields

Select all check boxes in Permissions Section

Click 'Create' Button

A Password will be generated. Copy this Password and save it to any local text file.

Go to Credential Manager - Windows Credential Manager

Delete the Bitbucket Logins saved.

Now go to Eclipse and try to do Commit and Push again

When prompted for Password, Provide the copied generated app password.

Now the Commit and Push should be successful without git-receive.-pack not permitted Error.

enter image description here

Upvotes: 0

Rishab Jula
Rishab Jula

Reputation: 107

Simple answer is - You don't have the write permission to the repo you are trying to push.

Upvotes: -1

doct0re
doct0re

Reputation: 393

Another issue could be that you have not checked all necessary checkboxes when creating the personal access token for Github.

In my case this was my mistake and by creating a new token with all rights / checkboxes checked when creating the personal access token, it worked fine.

Upvotes: 0

Asma Rahim Ali Jafri
Asma Rahim Ali Jafri

Reputation: 1383

Very basic but it happened to me: I didn't verify my email. Check you email, press the "verify email" button and then try pushing again.

Upvotes: -1

Surely your git user id and password are mismatched on configuration. Please recheck and make sure that your credentials are correct.

Upvotes: 0

Siva K
Siva K

Reputation: 21

I faced this issue with eGit and AnypointStudio ( with https protocol)

Solution-

  1. Generate a access token in the respective Git repo Settings, save this token aside.

  2. Go to Git Repositories -> Your Project -> Remotes -> origin -> Right click on Push(Red Arrow) and select Change Credentials.

Enter the access token generated in the first step in the password box and username,save and try to Push your local commit now.

For me it worked.

Upvotes: 2

Kurt
Kurt

Reputation: 383

Since my organization requires us to use SSH keys instead of username+password the way to make it work for me was:

  1. Right-click on your project in Eclipse --> Team --> Remote --> Configure Push to Upstream
  2. Next to the URI click on "Change"
  3. Choose protocol ssh
  4. Under Authentication --> User insert git (it seems that eclipse / git will automatically search for your id_rsa key file if you use the default username here - I tried adding my real username but that never worked)
  5. Finish & Save and Push

Upvotes: 0

YellowStrawHatter
YellowStrawHatter

Reputation: 948

I encountered this error when pushing to a GitLab repo, the username I was using does not have permissions to push to the branche's repository.

Changed the permission's level from reporter to master solved the problem.

Upvotes: 1

Ganesh Giri
Ganesh Giri

Reputation: 1161

If you ever run into a git-receive-pack not permitted error when using Git, chances are that it's a configuration issue on your end.In my case, I had cloned the repository using via https (which required authentication). However, pushing failed with the aforementioned error. This was due to the fact that I was only allowed to push via SSH. Therefore, once I changed the protocol in the configuration for my checkout, all was well again.

Since I use Eclipse (and eGit), it might be handy for some to know that the configuration settings for a Git-cloned project can be accessed via the project's context menu (right click), and choosing Team, Remote, and "Configure Fetch from upstream" or Configure Push to upstream", as applicable.

Hope this helps!

Upvotes: 0

Derek
Derek

Reputation: 51

In my case, it was because the permissions. we did some migration from gitlab to github. My colleague created a private project from our old project which I was working on. And after I finished, I found I was not able to push and got this error. Finally, we found it was because I wasn't added to the collaborator of this project. I thought it should be automatically done since I am one of the contributors of this project already. Hope it would be helpful for someone with similar issue.

Upvotes: 0

fl0w
fl0w

Reputation: 3897

As stupid as it may sound: Make sure you do have rights to push to the repo.

In my case the colleague hadn't given my user the push rights yet...

Upvotes: 14

webpat
webpat

Reputation: 1949

For some reasons egit doesn't seem to work with the Wincred credential store. You have to use the eclipse one.

  1. Open the Git Repositories perspective.
  2. Open the Remotes node and right click on origin (or the remote of your choice).
  3. Click on Configure Push then Change... button

  4. Fill in the Authentication section

  5. Make a Dry-Run to test

That should do the trick.

Upvotes: 1

Vlad.Bachurin
Vlad.Bachurin

Reputation: 1358

In my case I had to accept the invitation to the organization on Github.

Initially, I was trying to push my changes and was getting the mentioned error.

After I clicked on the link from the invitation letter, my push succeeded. Look for the email with the following content in your inbox and click on the link to join:

Hi <username>,

<other_username> has invited you to join the <org_name> organization on GitHub. Head over to https://<github_address>/<org_name> to check out <org_name>'s profile.

To join <org_name>, follow this link:

https://<github_address>/orgs/<org_name>/invitation?via_email=1

Some helpful tips:

  • If you get a 404 page, make sure you're signed in as <username>.
  • You can also accept the invitation by visiting the organization page directly at https://<github_address>/<org_name>

If you were not expecting this invitation, you can ignore this email.

Thanks, The GitHub Team

Upvotes: 2

user3620506
user3620506

Reputation: 129

just check "store in secure store" in context menu > team > remote > configure push to upstream > change. problem solved :D

Upvotes: 12

Charleston
Charleston

Reputation: 1569

sometimes you need to verify your account e-mail on github

Upvotes: 7

Venkat
Venkat

Reputation: 1259

I know this is a old thread, but I struggled with the same for more than an hour today and finally found out this happened because on my egit push dialog window i had used a different userid

Once i entered the right github user, the push to the remote repository went through fine.

Upvotes: 26

Related Questions