Trying to push to personal github - but thinks I'm using work git

Viewed 32

Recently got a work laptop with my work git and github accounts are connected via SSH however I started doing personal work on my work laptop and want to push to my personal github but I can't access it because it thinks I'm pushing from my work git. How do I fix this?

remote: Permission to Theqwertypusher/nextjs-blog.git denied to jvictor-wyze.
fatal: unable to access 'https://github.com/Theqwertypusher/nextjs-blog.git/': The requested URL returned error: 403

My git repo is set up like this origin https://github.com/Theqwertypusher/nextjs-blog.git (fetch)

Any help is greatly appreciated.

1 Answers

First, this has nothing to do with SSH, since the remote repository URL is an HTTPS one.

Check your credential helper:

git config credential.helper

If it returns, for instance, manager-core, type:

printf "protocol=https\nhost=github.com" | git-credential-manager-core erase

Then try to push again: a popup should ask you for your proper credentials (GitHub user account and password)

Replace "manager-core" by any other credential helper you might use.

If it does not find the git-credential-xxx executable, look for it in the Git installation path and use its full absolute path.

Related