curious: where does git store user information?

前端 未结 4 856
暗喜
暗喜 2020-12-15 17:30

I\'m wondering where does git stores user information. I created a repository, which both me and my friend works on. When we both commit, we can see both of us as individual

4条回答
  •  被撕碎了的回忆
    2020-12-15 18:06

    There are 3 default paths for the config file.

    • Repository itself: /.git/config
    • User home directory: ~/.gitconfig
    • System-wide directory: $(prefix)/etc/gitconfig

    The --global option always use the home directory. Note that git will always try to read all of them. If it finds one, it loads it, and moves to the next one. Local takes precedence over global, which takes precedence over system-wide. It uses a simple key-merging algorithm.

    Reference: git-config FILES

提交回复
热议问题