Matt
Matt

Reputation: 1839

Can't push to git

Once I had an old github account, and I'm trying to create a new one and push to that one, but I keep running into permission issues:

remote: Permission to <new account>/<new account>.github.io.git denied to <old username>.

I've tried setting the user name + password, going through different procedures to add ssh keys, deleting my .ssh folder, deleting my old repos, everything I can think of, but I can't fix this.

Upvotes: 1

Views: 115

Answers (1)

VonC
VonC

Reputation: 1323095

Check first if your URL is actually an SSH one:

git remote -v

If it is an https,... no amount of SSH setting will allow you to authenticate properly.
If it is an https (again), do check your credential helper with:

git config credential.helper

If you see manager, it is possible the wrong credentials are cached.
In that case, you need to remove them.
See "Github remote permission denied".

The other possibility is the presence of 2FA (2 factor Authentication), which would require a PTA (Personnal Access Token) in place of the regular account password.

But again, you can also switch to an SSH URL:

git remote set-url origin [email protected]:auser/arepo.git

Upvotes: 2

Related Questions