dylatwork
dylatwork

Reputation: 47

Branch still pushing from old account

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:

  1. 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.
  2. git config --global user.email "[email protected]"
  3. Setting up an SSH key for my new User Name
  4. 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.

Upvotes: -1

Views: 42

Answers (1)

dylatwork
dylatwork

Reputation: 47

I set up another ssh key and deleted my old one.

Upvotes: -1

Related Questions