安装配置

安装

window环境

下载安装即可

注意:安装路径不要有中文

mac环境

通过git --version查看是否安装,没有安装可以通过brew进行安装

$ brew install git

配置

配置文件为 ~/.gitconfig ,执行任何Git配置命令后文件将自动创建

# 默认配置,如果当前地址中仓库信息不存在则查看全局而后再读取系统配置
$ git config --list

# 本地仓库配置 高优先级
$ git config --local --list

# 全局用户配置 中优先级
$ git config --global --list

# 系统配置 低优先级
$ git config --system --list

# 配置全局用户、邮箱
$ git config --global user.name 'johncxf'
$ git config --global user.email 'johncxf@163.com'

# 配置当前仓库用户、邮箱
$ git config user.name 'johncxf'
$ git config user.email 'johncxf@163.com'

# 查看当前仓库用户、邮箱
$ git config user.name
$ git config user.email

results matching ""

    No results matching ""