You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ vim ~/.gitconfig
# or: $ git config --global --edit# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:# name = Qingquan Li # default use system username on macOS
email = liqqisme@gmail.com # GitHub Email
The text was updated successfully, but these errors were encountered:
获取帮助
若你使用 Git 时需要获取帮助,有三种方法可以找到 Git 命令的使用手册:
git help <verb>
git <verb> --help
man git-<verb>
例如,要想获得 config 命令的手册,执行
git help config
初次运行 Git 前的配置
配置用户信息
当安装完 Git 应该做的第一件事就是设置你的用户名称与邮件地址。 这样做很重要,因为每一个 Git 的提交都会使用这些信息,并且它会写入到你的每一次提交中,不可更改:
git config --global user.name "userName"
git config --global user.email xxx@example.com
再次强调,如果使用了
--global
选项,那么该命令只需要运行一次,因为之后无论你在该系统上做任何事情, Git 都会使用那些信息。 当你想针对特定项目使用不同的用户名称与邮件地址时,可以在那个项目目录下运行没有--global
选项的命令来配置。检查配置信息
使用
git config --list
命令来列出所有 Git 当时能找到的配置。使用
git config <key>
来检查 Git 的某一项配置注意
只要配置了 user.email=GitHub注册邮箱,提交代码到 Github 时就会显示提交者是当前 GitHub 用户。
The text was updated successfully, but these errors were encountered: