0

I have two git ID("theNameBeforeIUsed", "correctName"), and I want to change my session.

So I typed, $ git config user.email correctmail@email.com $ git config --global user.email correctmail@email.com $ git config user.name "correctName" $ git config --global user.name "correctName" $ git push origin master

But, permission error occurred remote: Permission to ~~~.git denied to theNameBeforeIUsed. fatal: unable to access '~~~.git/': The requested URL returned error: 403

How can I logout "theNameBeforeIUsed" and login with "correctName"?

fre bern
  • 53
  • 7
  • I found answer! The windows saved my git credentials. https://stackoverflow.com/questions/28238037/git-log-out-user-from-command-line – fre bern Jun 29 '17 at 05:55

1 Answers1

1

probably when you clone the repository you use something like this theNameBeforeIUsed@yourgit.com:proyect.git

so if you change the user when it connect to git it will use theNameBeforeIUsed instead the new user then you need change the file .git/config

and where it say

[remote "origin"]
    url = theNameBeforeIUsed@yourgit.com:project.git

use the https version of your project or change there your user, I personally prefer https because is more secure and always ask your user avoiding misunderstandings

Emiliano
  • 698
  • 9
  • 30