Search code examples
gitgitlabgithub-for-mac

GitLab showing computer name + router name as commiter name


I recently reinstalled GitHub Desktop (the Git client I use) and now all my commits I do to a GitLab projects show up from the username "[My mac username]@[My computer name].[Name of my router]" instead of the username I have in the GitLab installation.

What have I done wrong? How can I fix this?


Solution

  • Git does commits entirely locally on your machine, the site you push those commits just reads them. So your Gitlab account has nothing to do with who you're committing as. This is critically important for the integrity of who did what and when.

    What you're getting is the default username from Git. The Git command line client would normally issue you a warning and instructions:

    $ git commit
    [master (root-commit) cc46c07] Foo
     Committer: Michael Schwern <[email protected]>
    Your name and email address were configured automatically based
    on your username and hostname. Please check that they are accurate.
    You can suppress this message by setting them explicitly:
    
        git config --global user.name "Your Name"
        git config --global user.email [email protected]
    
    After doing this, you may fix the identity used for this commit with:
    
        git commit --amend --reset-author
    
     1 file changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 bar
    

    Github Desktop likely has its own config. It will use your Github identity, not your Gitlab. Make sure you're logged in at Preferences->Accounts. Also check Preferences->Advanced and make sure your Git Config identity is correct.