0

When I push my repositories to GitHub, all the commits are signed by another user.

I've set the user name, email & password in the git config file and they are correct.

I also run git remote add origin ... and git remote set-url origin ... to set the new url before pushing the repository.

Previously, I had the repositories on GitLab where they were also incorrectly signed by the other user.

How can I get the commits to be signed by the new user?

SK1dev
  • 1,049
  • 1
  • 20
  • 52
  • 3
    Setting the email & password will only affect commits that you create (via `git commit` mostly) after you've set that up, it will **not** affect any existing commits. So if you just pull from A and push to B, then the commits will look the same, no matter what you configured. – Joachim Sauer Apr 11 '22 at 11:33
  • 1
    to add to what @JoachimSauer said - you will have to do interactive rebase to fix your old commits if you need/want to. – Dmitry Apr 11 '22 at 11:40
  • Thanks! What's strange is these were always my commits and not the other users code at all. How would I fix the commits with interactive rebase? @Dmitry – SK1dev Apr 11 '22 at 12:12
  • Please check this querry answered in another place [Answers](https://stackoverflow.com/questions/26004587/git-commits-are-not-getting-linked-with-my-github-account ) – Jakeer Apr 11 '22 at 12:41

0 Answers0