I needed to switch github accounts to push something to a company github account. I tried to change to my new username but constantly get rejected.
remote: Permission to Company/project.git denied to oldUserName. fatal: unable to access 'https://company.com/Company/project.git/': The requested URL returned error: 403
Here is all the troubleshooting I've done:
- gh auth logout/gh auth login. When I check the status, I'm apparently logged into the correct account but still can't push from it.
- git config --global user.email "newemail@company.com"
- Setting up an SSH key for my new User Name
- git remote set-url https://github.com/userUserName/project. The url was gotten from git remote -v and the following error was gotten:
usage: git remote set-url [--push] <name> <newurl> [<oldurl>] or: git remote set-url --add <name> <newurl> or: git remote set-url --delete <name> <url> --[no-]push manipulate push URLs --[no-]add add URL --[no-]delete delete URLs enter code here
I've read through plenty of stackoverflow questions and github tutorials but they all seem to be failing. I really appreciate any advice or help.