2

So I have been trying to git push to a remote repository. It usually works but it wasn't until recently I have been getting these errors.

Your local git email (git config --global user.email) does not match
the one associated with your BitBucket account. This can be set via
the command: git config --global user.email <email>

Your local git username (git config --global user.name) does not match
the one associated with your BitBucket account. This can be set via
the command: git config --global user.name <"User Name>

expected committer name 'My, Name' but found 'Anonymous'

I used git log and put in the exact same name/email that I have been using but it won't save or acknowledge. I still get these errors. When I use the command it tells me, nothing happens. I was told to use a git rebase but I have no idea how to use that or what it is even. For some reason it still has me under Anonymous even after I use the command it tells me to change it and put my email/name to match what is on my Bitbucket account. Any suggestions?

EDIT: When I type

git config --global user.name

and

git config --global user.email

It tells me the correct name and email its suppose to say

jason ap
  • 71
  • 2
  • 9

1 Answers1

1

It sounds like you would have to change the email address on your previous commits. You can change the email address on all of your previous commits with:

git rebase --root --exec "git commit --amend --author='name <email>' --no-edit"

You can check out this question and its answers for more options about changing the email address on one or more specific commits (if you don't want to change all of them).

D Malan
  • 10,272
  • 3
  • 25
  • 50
  • Do I type it in exactly like this, all one line, but only put my name and email in the `--author='name '` section? With the single & double quotes and `<>` included aswell? – jason ap Sep 26 '19 at 14:47
  • 1
    Single & double quotes — yes; `<>` — yes, but please understand that `name ` has 2 placeholders: you must put your real name and email, not literal words `name` and `email`. – phd Sep 26 '19 at 15:14