I am encountering permission denied errors when trying to push changes to a GitHub repository, even after updating the Git configuration with the correct username. The error message persists, stating: “Permission denied to VIJAYANAARAAYANAN.”
Background:
I have a GitHub repository named Netflix-clone associated with the GitHub account VijayNaaraayanan.
Initially, I was pushing changes using the wrong username (VIJAYANAARAAYANAN). Then, I updated the global Git configuration with the correct username (VijayNaaraayanan).
Steps Taken:
git config –global user.name
The output confirmed that the username is set correctly to VijayNaaraayanan.
git credential-cache exit
git credential-manager erase
git push -u origin main
Expected Result:
I expect the changes to be pushed to the GitHub repository associated with the correct username (VijayNaaraayanan).
Actual Result:
I’m still encountering the “Permission denied to VIJAYANAARAAYANAN” error, preventing me from pushing the changes to the repository.
Additional Information:
I’m using Git Bash on Windows.
The repository URL is correct.
I have generated a personal access token and used it as the password during the push operation.
I have also tried switching to SSH authentication, but the issue persists.
Question:
How can I resolve this permission denied error and successfully push my changes to the GitHub repository associated with the correct username (VijayNaaraayanan)?
VIJAYA NAARAAYANAN B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.