The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Figuring out the cause of a GitHub personal access token throwing “remote: Permission to write to gist denied.”

Posted by jpluimers on 2024/01/17

Last week I mentioned

My forking was needed because of [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “Need @github help: Personal Access Token fails on … with a “The requested URL returned error: 403″, but works fine on … Why is that? (I own both repositories)”

So after the stop gap measure I described in the blog post Fork Gist to Repo on GitHub – Stack Overflow, I did not stop.

I searched for [Wayback/Archive] “remote: Permission to write to gist denied.” – Google Search which only gave one result:

[Wayback/Archive] can’t push to a gist – permission denied message – GitHub Help / How to use Git and GitHub – GitHub Community. It was of no use as it mentioned you could just a plain password login (which fails with the same error), or not use .netrc (which I did not use).

So I added more search terms, which not gave less results, but (since the quoted exact match would make it return zero results) returned more results.

Now [Wayback/Archive] “remote: Permission to write to gist denied.” even with personal access token – Google Search gave me these (which I filtered so I could explain a few):

So I looked at the token in github.com/settings/tokens and indeed [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “No help from @github, but I have figured it out. Screenshot 1 is what the token is allowed to do. The unchecked “gist=Create gists” is not just for creating gists, but also to any other write operation to gists. So I recreated the token with “gist=Create gists”: now it works!”

 

Now it works:

# git push origin 
Username for 'https://gist.github.com': jpluimers
Password for 'https://jpluimers@gist.github.com': 
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 1.98 KiB | 1.98 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://gist.github.com/fcc601dd41ac89f601a5174be92c841c.git
   e3683fb..391d638  master -> master

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.