Error updating my remote repository in Git hub

3

I have the following error when updating my remote repository to git hub

C:\xampp\htdocs\mvc>git push
remote: Permission to otrousuario/mvc.git denied to usuario.
fatal: unable to access 'https://github.com/otrousuario/mvc.git/': The    requested URL returned error: 403

when I check my status remotely

git remote -v
origin  https://github.com/otrousuario/mvc.git (fetch)
origin  https://github.com/otrousuario/mvc.git (push)

I'm new to this repository in .git, I hope you can help me

Note Those two users are two accounts that I have, but apparently does not ask me for the user and password of the "other-user" user, it could also be done that I know who I want to do the user push

    
asked by Miguel Osorio 14.10.2016 в 04:13
source

1 answer

3

Good morning.
Apparently GitHub does not support writing through the Https protocol, only SSH.

You must change the address of your remote repository in the following way: [ Changing remote's url ]

git remote set-url <name> [email protected]:<username>/<repo>.git

where <name> is the name of the remote repository (in your case it is origin), therefore it should look something like this:

git remote set-url origin [email protected]:otrousuario/mvc.git  

You can also do this by editing the .git / config " file in the directory where your local repository is.

  • Find url=[...] where it says [remote "origin"]
  • Change it from url=https://github.com/otrousuario/mvc.git to url=ssh://[email protected]/otrousuario/mvc.git .
  • Save the configuration file.

Now you can "push" to the remote repository. If you do not have an SSH key you must create one using the command ssh-keygen [ Generating SSH keys ] on the git console. Then you must add the public key to your Github profile.

You can find more information in the following links:

Starting with Git
Remote Repositories
Error 403 with Git over HTTPS
Generate SSH key

    
answered by 14.10.2016 / 08:24
source