-1

I want to change my local git username (bitbucket). I have already change the username for commit using :

$ git config --global user.name "John Doe"...

it works fine for the commit, but for the pull request the previous username appear again.

Mohamed
  • 19
  • 8
  • How are you raising a pull request? Using the web UI right? Or is there another way? – clamentjohn Mar 12 '19 at 10:02
  • You'll probably need to amend those commits. Changing the config only applies to future commits. – evolutionxbox Mar 12 '19 at 10:02
  • Possible duplicate of [How to change the author and committer name and e-mail of multiple commits in Git?](https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi) – phd Mar 12 '19 at 12:32
  • https://stackoverflow.com/search?q=%5Bgit%5D+change+author – phd Mar 12 '19 at 12:32

1 Answers1

1

For last commit, amend commit:

git commit --amend --reset-author

For commits earlier, rebase with hash:

git rebase -i COMMIT_HASH
# and follow the interactive rebase
David Zhang
  • 468
  • 7
  • 10