If you have a recent Git client version installed, you can use the browser authentication flow, this doesn’t need the additional set-up steps of PATs or SSH Keys, which can be helpful if you are unfamiliar with both, or are having problems.
In relation to PAT problems
Some basic troubleshooting tips are
Does the token have the needed scope permissions?
Was the token copied and pasted correctly (care with some hidden controls characters that my be included with certain editors/OS if stored in editors)
Ensure you have not overridden the what credential to use in you local .gitconfig
Two simple Troubleshooting things you can do are
Delete any cached credentials from your local credential manager and re-enter you PAT when
prompted for password to ensure the PAT you think you are using is the one actually being used.
These two commands entered in GitBash should confirm the token you have saved locally is valid and what scope it has (replace OWNER/REPO with appropriate values of target repository)
$ MY_PAT= < INSERT you token here >
$ curl https://api.github.com/repos/OWNER/REPO -is -u “user:$MY_PAT” | grep ‘“permissions”|“admin”|“maintain”|“push”|“triage”|“pull”|x-oauth-scopes:’
yes i am facing the same issue in AWS linux, showing invalid username or password and fatal error… following type of error is comming
remote: Invalid username or password.
fatal: Authentication failed for ‘https://github.com/amanyele30/centralRepo1stma y2022.git/’.