Michael Edwards
Michael Edwards

Reputation: 58

Git command line thinks I am a past account I previously used

My git intall seems to think I am still a previous user I had dispite the lengths I've gone through to remove this.

Currently the only feedback I am getting is this error message

remote: Permission to Mike4driver/LoftyPracticalDjangoProject.git denied to MikeTokensoft.
fatal: unable to access 'https://github.com/Mike4driver/LoftyPracticalDjangoProject.git/': The requested URL returned error: 403

MikeTokensoft was my previous account I used for work and I'm trying to switch back over to my personal account. Ive switched my work email in my global config to my personal one and verified this has changed to that and it is shown as such in new commits I make locally. My old account had a Access token I was using for it which I removed. My understanding is that that was what was located in my .git-credentials file so I removed everything in there which was just that one line. Then I removed from my git config everything under the [credentials] section.

I'm not sure where else I can look to find out where my machine is currently pulling the MikeTokensoft Identity from and how I can remove this. Here is the output of my git config -l

user.email=My Real email that I replaced for stackoverflow
user.name=My Real Name that I replaced for stackoverflow
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/Mike4driver/LoftyPracticalDjangoProject.git

Any suggestions would be appreciated.

Upvotes: 2

Views: 70

Answers (1)

VonC
VonC

Reputation: 1324537

Check first your git credential helper:

git config --global credential.helper

If you get a value (say xxx), check what is stored in that helper:

printf "host=github.com\nprotocol=https" | git-credential-xxx get

If you see the old token, for the old account, remove it, and store the new one.

printf "host=github.com\nprotocol=https\nusername=Mike4driver" | git-credential-xxx erase

printf "host=github.com\nprotocol=https\nusername=NewAccount\npassword=yourToken" | git-credential-xxx store

Upvotes: 1

Related Questions