I am trying to push a project to a remote repository from the command line.
From inside my local directory, I hit:
$ git push
and obtain the following error:
remote: Permission to username1/repo.git denied to username2.
fatal: unable to access 'https://github.com/username1/repo.git/':
The requested URL returned error: 403
username1 is my github account username hosting the repository I want to push to and
username2 is an old account I used to use on this machine.
I am using OS X Yosemite (v10.10.5) on a Macbook Air. And I would prefer to use https instead of ssh.
How do I update to
username1 so I can successfully push to my remote?
Edit: To be clear, I am not talking about simply editing the
config user object, e.g.,
$ git config --global user.name "Billy Everyteen" $ git config --global user.email "firstname.lastname@example.org"
They have nothing to do with authentication. My question deals with user authentication necessary to write to my remote repository.