I have have been using my personal git and github accounts on my work computer Windows10 but would like to start using work accounts instead.
I have created a new work account and repository on github. After cloning the repository to my local machine, making a commit and then trying to push I get the following error.
! [remote rejected] release -> release (permission denied)
error: failed to push some refs to
git config --get user.email
git remote -v
origin https://github.com/workuser/workrepo.git (fetch)
origin https://github.com/workuser/workrepo.git (push)
You tried to push to the https link of your repo and that won't work (without manually typing your username and password). You have to use the ssh version of the link!
To change the link for the remote origin open a console in the directory of your repo and type:
git remote set-url origin firstname.lastname@example.org:workuser/workrepo.git
Now you should be able to push to github.