5

From github documentation

GitHub recommends that you use fine-grained personal access tokens instead of personal access tokens (classic) whenever possible

I need a simple token to access the repository (so git clone via https will work). I made it work with classic token but even with all possible permission fine-grained token returns remote: Write access to repository not granted.

Shouldn't be code access base functionality? Is there fine-grained token replacement to read and write to the repository?

kosciej16
  • 6,294
  • 1
  • 18
  • 29
  • Voting to re-open because this question is about `git clone` and the linked duplicate is about `git pull`. I cannot use a fine-grained token for `git clone` - except in the way shown in a different question [GitHub clone repo with fine-grained personal access tokens (PAT)](https://stackoverflow.com/q/74532852/12567365) - and that way has the disadvantage that it requires you to place the token in the URL (bad idea). I was not able to adapt the approach in this question's dupe-target to work with `git clone` in a way which protects the token. – andrewJames Dec 21 '22 at 02:00

2 Answers2

-1

I can get access token via fine-grained PTA. There are there ways to get it.

You need to give a correct write permission into PTA. Detail information here. Using a GitHub fine-grained token with git pull over HTTPS

Bench Vue
  • 5,257
  • 2
  • 10
  • 14
-1

I also start using fine-grained tokens recently I was able to clone with not issues with the following command with including oauth2 in the url

git clone https://oauth2:$TOKEN@github.com/ORG/REPO.git