I ran:
$ git config credential.helper store
And then:
$ git push origin master
After pushing, I entered my creden
Your credentials are stored in the file you (or the thing using git credential-store) specified when you (or it) ran the command, as described in the documentation. The default is $HOME/.git-credentials
. You should be able to open this file in your editor and edit it, or simply remove it entirely.
Note that you may also want to change the credential helper so that these are not stored again. See the git credential-cache documentation as well, for instance.
Run the following command in the terminal to remove your credentials stored in the cache
git config --global --unset credential.helper
None of the above solutions worked for me. I revoked the access by deletion of the token I had generated the machine.
I logged into GitHub webpage went to: click picture > settings > Developer settings > Personal access tokens > delete the token for that particular machine
If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action, run the following command.
git credential-cache exit
As he did not give any flag as global or local or system, it would take local by default, so the correct way is to move to the respective folder(repository) and type this command
git config --local --unset credential.helper
or
git config --unset credential.helper
Reference: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config