Any one knows how to solve authentication error while pushing file,I tried to generate token but again failed several times.
Asked
Active
Viewed 210 times
0
-
Please provide enough code so others can better understand or reproduce the problem. – Amit May 31 '22 at 01:58
1 Answers
1
Git doesn't know what to do with the unexpected string you gave it. Please make a copy of your local repository (always good to have backups in these cases) and then run the following commands:
git remote remove origin
git remote add origin https://<GITHUB_ACCESS_TOKEN>@github.com/<GITHUB_USERNAME>/<REPOSITORY_NAME>.git
git push
# Or in your case:
git push java master
Where you have to exchange <GITHUB_ACCESS_TOKEN>, <GITHUB_USERNAME>, and <REPOSITORY_NAME> with the relevant values.
According to techglimpse this can also be done with the following line:
git push https://<GITHUB_ACCESS_TOKEN>@github.com/<GITHUB_USERNAME>/<REPOSITORY_NAME>.git
Other solutions might be found in this similar question.

Decclo
- 71
- 4
-
I had to follow exactly the operations described to be able to connect again. – mlstoppa Sep 17 '22 at 05:29