I did git clone
to a repository hosted on github:
$ git clone https://github.com/USUARIO/REPOSITORIO.git
Then I did a git fetch --all
to move to the branch dev
:
$ git fetch --all
$ git checkout dev
To make sure I was in dev
:
$ git branch
*dev
master
Now, my problem is that I want to work on that repository with a specific user, for which I executed:
$ git config user.email [email protected]
$ git config user.name MI_USUARIO_ESPECIFICO
I checked the local configuration file of git
which I returned correctly:
$ cat .git/config
[user]
email = [email protected]
name = MI_USUARIO_ESPECIFICO
I added a file to the project:
$ git add assets/js/dependencies/jquery.min.js
I did his respective commit which he did correctly:
$ git commit -m "Dependencia jQuery añadida"
I proceeded to make your push origin HEAD
$ git push origin HEAD
And he returned this error:
remote: Permission to USUARIO/REPO.git denied to MI_USUARIO_GLOBAL.
fatal: unable to access 'https://github.com/USUARIO/REPO.git/': The requested URL returned error: 403
Should I not ask for the credentials of the USER_ESPECIFICO?
Why is this error and how can I correct it?
NOTE
I am sure that the repository exists and the USER_ESPECIFICO already has permissions in it