tanjim anim
tanjim anim

Reputation: 531

git config changes email and username but commit and pushes done via previous user

I changed my git config user.name and user.email using the command git config --global user.name name. When I run git config --global --list in terminal or in command prompt, I get my credentials. But when I push or commit, the commit/push goes from previous user. What should I do? Right now I am doing commit/pushes from github desktop.

Upvotes: 0

Views: 54

Answers (3)

tanjim anim
tanjim anim

Reputation: 531

So basically, windows credentials cached git credentials. So, I went to control panel > credential manager > windows credential. There you will be seeing git:github.com or something similar. Check if it's your account. If it's not, then edit it or remove it(in my case I edited).

Upvotes: -1

LeGEC
LeGEC

Reputation: 52026

Changing user.email in your configuration will change the email in the commits you create from now on, but does not change the author of already existing commits.

If you want to modify the author of your previous commits: you will have to rewrite them.

See for example this answer: https://stackoverflow.com/a/1320317/86072

Upvotes: 1

MikeJ82
MikeJ82

Reputation: 330

Git also has a config for each repository. Try going to your repo (with your command line tool) and change the config without the --global argument.

Upvotes: 1

Related Questions