Skip to content

Instantly share code, notes, and snippets.

@M2shad0w
Created August 2, 2016 01:25
Show Gist options
  • Save M2shad0w/e39a254f1f73f0f87e91a3b6b89d9060 to your computer and use it in GitHub Desktop.
Save M2shad0w/e39a254f1f73f0f87e91a3b6b89d9060 to your computer and use it in GitHub Desktop.
git config user info

用户信息 第一个要配置的是你个人的用户名称和电子邮件地址。这两条配置很重要,每次 Git 提交时都会引用这两条信息,说明是谁提交了更新,所以会随更新内容一起被永久纳入历史记录:

$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]

如果用了 --global 选项,那么更改的配置文件就是位于你用户主目录下的那个,以后你所有的项目都会默认使用这里配置的用户信息。如果要在某个特定的项目中使用其他名字或者电邮,只要去掉 --global 选项重新配置即可,新的设定保存在当前项目的 .git/config 文件里。

@M2shad0w
Copy link
Author

M2shad0w commented Aug 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment