Git 使用配置

应用情景:使用Git前需要配置 user.name 和 user.email 信息。Git利用这些信息记录谁进行了什么样的操作。Git属于分布式版本管理系统,开发者很多,配置这个就相当于自报家门,告诉别人我是谁,所以需要有意义的配置信息。

1、安装Git,步骤不再叙述。

2、配置全局 user.name 和 user.email,全局配置作用于本地Git管理的所有项目:

git config --global user.name "xxx"
git config --global user.email "xxx@163.com"

3、如果不想使用全局配置或是某个项目需要单独配置 user.name 和 user.email:

git config user.name "xxx"
git config user.email "xxx@163.com"

4、查看Git配置信息,包括全局配置和项目当前配置,二者都有的情况下,Git优先使用项目当前配置(就是3中的配置):

git config --list
原文地址:https://www.cnblogs.com/litmmp/p/5222712.html