I put in the wrong email, how do I reset it? #22127
-
I put in the wrong email and now I can’t push to my repository. How do I reset it? |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments
-
Did you use the ‘git config --global’ syntax ? or just at the prompt when committing / pushing ? |
Beta Was this translation helpful? Give feedback.
-
At the prompt when commiting/pushing |
Beta Was this translation helpful? Give feedback.
-
Just try the commit / push again. Or permanently store your credentials with ‘config --global’ or ‘credential-store’ option. |
Beta Was this translation helpful? Give feedback.
-
Wait no, I think I also used the --global syntax as well |
Beta Was this translation helpful? Give feedback.
-
By that I mean when it prompted me it told me to use --global |
Beta Was this translation helpful? Give feedback.
-
Then just run global again and change the credentials |
Beta Was this translation helpful? Give feedback.
-
I tried that, it didn’t work (unless I’m doing something wrong) |
Beta Was this translation helpful? Give feedback.
-
Might any of the mail addresses in your commits be ones that you’ve configured Github to keep private? In general it’ll be easier to help you if you post the exact error message (you can censor any private details). |
Beta Was this translation helpful? Give feedback.
-
Sure, give me a second |
Beta Was this translation helpful? Give feedback.
-
git@github.com: Permission denied (publickey). Please make sure you have the correct access rights |
Beta Was this translation helpful? Give feedback.
-
That error message has nothing to do with mail addresses, it means Github doesn’t accept your SSH key for login. This can have a bunch of reasons:
I recommend taking a look at the documentation on Connecting to GitHub with SSH, it has pages for each of those possible problems. |
Beta Was this translation helpful? Give feedback.
-
Thank you, it worked! However it appears I have a new problem. When I try to push it tells me to pull, but when I try to pull it returns this error:
|
Beta Was this translation helpful? Give feedback.
-
That means your local repository has no commits in common with the remote one. Did you change the first commit by any chance (e.g. using |
Beta Was this translation helpful? Give feedback.
-
I think I used git rebase once. |
Beta Was this translation helpful? Give feedback.
-
If that rebase changed the first (“initial”) commit in the repository that’s probably the reason. In general rebasing history that’s shared will have funny results. There are a few things you can do to resolve this. But all of them carry a risk of messing up and losing data, so be very careful!
|
Beta Was this translation helpful? Give feedback.
-
Thank you, it worked! Thank you for all the help. |
Beta Was this translation helpful? Give feedback.
That error message has nothing to do with mail addresses, it means Github doesn’t accept your SSH key for login. This can have a bunch of reasons:
I recommend taking a look at the documentation on Connecting to GitHub with SSH, it has pages for each of those possible problems.