How do I switch accounts in git?

Asked

Viewed 28 times

-3

I’m learning to use git, my brother was programming with the computer I’m on now and had his github account in git but I committed some files and I can’t tell if it went to his account! Then I gave a git reset HEAD~1 which I searched for reverses my commit, after which I removed his account in the Credentials Manager in the Control Panel but I gave a git config --list and his account is still in git!

If anyone can tell me if what I did was right, explain to me if it affects something in his git and github and tell me how to remove his account to add my account

  • Every time you pick up a second-hand computer format it before using.

1 answer

2


Opa, you need to configure GIT to use your user:

This way Oce changes only in 1 repository:

git config user.name "seu nome"
git config user.email "seu@email"

In this way, the global scope changes:

git config --global user.name "seu nome"
git config --global user.email "seu@email"
  • In this case I put the user and email from github? And what I did above is that it was correct or affects something in my brother’s git or github?

  • If you use the first example, no, you do not affect your brother’s. Yes, use the Github account.

  • Opa I managed to do here, thank you very much for the attention!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.