[Fix] remote Write access to repository not granted.

The Error “remote: Write access to repository not granted.”, is an error that is invoked whenever you are trying to use someone else’s repository and also using their personal token. Given below is the snippet of the error you might get:

remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/...../...../': 
The requested URL returned error: 403

I would like to share with you the steps I took to fix the “remote: Write access to repository not granted.” in your project file.

Why “remote Write access to repository not granted.” Error is Seen?

The error, “remote: Write access to repository not granted.” is seen because you are using someone else’s PAT, or personal access token in a repository which you do not own.

So it is a warning that you are not suppose to get the write access for someone else Git repository as you don’t have the authorized PAT access.

Furthermore, applications may always send users back through the procedure to get extra permission, but users can always say no.

The detailed solution to fix the error “remote: Write access to repository not granted.”, is given below:

How to fix the error remote Write access to repository not granted.?

To fix the error remote: Write access to repository not granted in Git, you have to recreate a PAT (Personal Access Token) with the scope as the “repo” ones.

If you are testing PAT in your repository then choose an expiration date as “never”, to be sure that you PAT will be valid through out the period you will be testing in you repository.

The scope attribute lists the user-granted scopes associated to the token. Typically, these scopes will be the same as what you asked. Users, on the other hand, may change their scopes, essentially allowing your application less access than you asked.

Additionally, when the OAuth procedure is complete, users may update token scopes. You should be aware of this possibility and modify the behavior of your application appropriately.

Scopes allow you to define precisely what kind of access you want. Scopes restrict OAuth token access. They do not provide any more permissions beyond those currently provided to the user.

Requested scopes are presented to the user on the permission form when creating an OAuth App on GitHub.

Below are the mentioned available OAuth repo scope in official Git documentation:

NameDescription
(no scope)Grants read-only access to public information (including user profile info, repository info, and gists)
repoGrants full access to repositories, including private repositories. That includes read/write access to code, commit statuses, repository and organization projects, invitations, collaborators, adding team memberships, deployment statuses, and repository webhooks for repositories and organizations. Also grants ability to manage user projects.
repo:statusGrants read/write access to commit statuses in public and private repositories. This scope is only necessary to grant other users or services access to private repository commit statuses without granting access to the code.
repo_deploymentGrants access to deployment statuses for public and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, without granting access to the code.
public_repoLimits access to public repositories. That includes read/write access to code, commit statuses, repository projects, collaborators, and deployment statuses for public repositories and organizations. Also required for starring public repositories.
repo:inviteGrants accept/decline abilities for invitations to collaborate on a repository. This scope is only necessary to grant other users or services access to invites without granting access to the code.
Scopes for OAuth Apps

It is critical to handle incorrect cases in which a user decides to provide you less access than you asked. For example, programs may warn or otherwise communicate with their users that their functionality will be reduced or that they will be unable to execute certain tasks.

Follow the steps mentioned below to fix the “remote: Write access to repository not granted.” in Git Error:

First you have to recreate a PAT, Personal Access Token, with, the scope as the repo ones. If you will be testing in your repository then chose an expiration date as “never”, to be sure that you PAT will be valid through out the period you will be testing in you repository.

The personal access token should start with ghp_.... The PAT then should authenticate you properly, also allowing you to clone the repository, and then push back to it.

Please make a note that a personal access token is similar to a password, but can easily be revoked/regenerated, so you should not use any other personal access tokens but the ones you own.

This should fix the error, “remote: Write access to repository not granted.” in Git.

Conclusion

To fix the error “ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries”, you will have to recreate a PAT, Personal Access Token, with the scope as the repo ones.

If you will be testing in your repository then chose an expiration date as “never”, to be sure that you PAT will be valid through out the period you will be testing in you repository.