2

I have committed some files with wrong author name, when I saw with git config -l, it is sawing some other user details and my files were committed under those user details.

Now I want to change author name from existing commit.

I got some POST with ans but they are providing solution which will replace the auther from all commits.

I want to change author from some specific commits only.

Poonam Bhatt
  • 10,154
  • 16
  • 53
  • 72
  • This might have been a better duplicate target: [Change commit author at one specific commit](http://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit). –  May 18 '14 at 17:18

1 Answers1

1

If it's the last commit only use

git commit --amend --reset-author

Or if you want to change it to something not in your .gitconfig

git commit --amend --author="Name <email@example.com>"

If it's the last couple of commits you can combine this with a git-rebase

NOTE It's recommended that you don't use this if you already have pushed your work, it will require a force push and will conflict with all the people who are working with you on the project.

Mohammad AbuShady
  • 40,884
  • 11
  • 78
  • 89