3

I have a github account. When I make commits it shows a different user than my github account username. How can I fix that?

enter image description here

1 Answer 1

4

At the root of your local folder you have a file named "config". Try to "vim .git/config"

The file will look something like that:

[core]
        repositoryformatversion = 0
        fileMode = false
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
[remote "origin"]
        url = https://[email protected]/nanhekumar/myproject.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master`

    [user]
            name = Nanhe Kumar
            email = [email protected]

A few options:

  1. Change the user name and email in this file
  2. Use "git config" command to change a global user for pushing to github or a local user for a specific folder project:

Local:

  • git config --local user.name ""
  • git config --local user.email "< your email>"

Global:

  • git config --global user.name ""
  • git config --global user.email "< your email>"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.