can't push to a gist - permission denied message

I though this would be easy but seem to be stumped…I am trying to update a gist file through conventional git commands but can’t seem to do so, getting a push failure.  

Here’s what I have tried so far (based on what works for regular github repos under my account):

  • I created a public gist using the UI and then cloned it over https
  • I’ve set my local git config user.name to match my github user name, and set the email to the private format that github assigns. (And also triedmy normal, registered email)
  • specified a full access PAT for my password. (And also tried my github login password)
  • Made a local edit and commit
  • But the push fails. I get:  remote: Permission to write to gist denied.

I don’t see any setting to control permissions to a gist. Or have I missed it somewhere?

When you clone the repository over HTTPS, you should get a login prompt when you attempt to push. For that login prompt, you should supply your normal GitHub username and password, a personal access token is unnecessary. You can use your standard git user.name and user.email configuration that you use for any other repository.

Do you have a link to the gist that you created for this experiment?

Hi Lee-dohm

Thanks for your suggestion. In fact what I believe caught me was the fact that I had been authenticating under-the-hood using a .netrc file, which originally only had an entry for github.com but not _gist._github.com. Since I fixed that I no longer have the issue. Me bad for not posting to this effect earlier!

Thanks for following up! That’s a great point and I’m glad you got it figured out :grinning: