How to use git (git config --global)?

后端 未结 4 1953
滥情空心
滥情空心 2021-02-06 21:25

The Pragmatic Guide to GIT has the following \"Git uses both to calculate the commit ID—a SHA-111 hash—that identifies each commit.\" in page 21.

And in page 22, I can u

相关标签:
4条回答
  • 2021-02-06 22:05

    Not sure where "smcho" comes from, but the setting to set your name is user.name:

    git config --global user.name "Your Name"
    

    You can set your e-mail address too:

    git config --global user.email "name@domain.example"
    

    I guess the reason it complains about the lack of a section is that the name of the parameter to set probably needs to be in two parts: section.parameter_name (You can see the sections names within [] if you look in the configuration file, for example in .git/config).

    (None of this is specific to OSX as far as I'm aware.)

    0 讨论(0)
  • 2021-02-06 22:16

    to edit the whole config file

    git config --global --edit
    
    0 讨论(0)
  • 2021-02-06 22:19

    A simple answer to this question/problem is that do not replace "user.name" with your actual git username leave the user.name as it is the command needs to be:

    git config --global user.name "Your Name here only"
    
    0 讨论(0)
  • 2021-02-06 22:29

    This error is because you have this word (smcho) at the beginning of your .gitconfig file at home directory.

    Bit late, but could be useful to somebody.

    0 讨论(0)
提交回复
热议问题