Xcode source control wrong username on github

GitHub uses the email address in the commit header to link the commit to a GitHub user.

Xcode pulls used to pull your email details from Contacts. If you have multiple email addresses associated with your own contact card, Xcode is choosing a different email address to use that doesn't match your Github username email.

I don't believe there's a way to specify which email address to use within Xcode, but you can specify it in a local or global Git configuration file.

Update:

Try these commands, to provide Xcode with your git username and email:

xcrun git config --local user.name 'new_user_name'
xcrun git config --local user.email '[email protected]'

Try deleting and re-adding the repository with correct github credentials.

Under Preferences->Accounts.


Had this problem when I changed my github username in Xcode 9. The only way I could change the login credentials when committing or pushing my files was through this method.

For Xcode 9: Go to Xcode-> Preferences-> Accounts. Under "Source Control Accounts", delete your github account that is saved there and re-create it. If it isn't obvious, use the - or + sign to delete or create a new one.

Seems pretty simple, yet I couldn't figure it out for hours. Might run into a few issues you have to kink out with resetting, but it was the only thing that worked. I personally didn't have any issues.

Tags:

Git

Xcode

Github