My Git Pull/Push records from different account

121 views Asked by At

How to change the account in git during pulling/pushing?

I am using git bash in my terminal whenever I pull/push. After that it shows on our repo's activity that I PUSHED as different person.

Here's an Example: 'name-of-other-account-here' pushed to branch master

Which is supposed to be:'my-account-here' pushed to branch master

1

There are 1 answers

0
Sajib Khan On BEST ANSWER

Change your user/email in git config.

# Change just for a single repo. Go into the repo.
$ git config --local user.name <your-name>
$ git config --local user.email <your-email>

# Or, change globally (for all repos)
$ git config --global user.name <your-name>
$ git config --global user.email <your-email>

$ git config --list       # check 'user.name' and 'user.email'