第四章 初次运行GIT前的配置

配置git

#命令集
git config --global user.name "clsn"  #配置git使用用户
git config --global user.email "admin@znix.top"  #配置git使用邮箱
git config --global color.ui true  #语法高亮
git config --list # 查看全局配置

#配置过程
[root@gitlab ~]# git config --global user.name "clsn"  #配置git使用用户
[root@gitlab ~]# git config --global user.email "admin@znix.top"  #配置git使用邮箱
[root@gitlab ~]# git config --global color.ui true  #语法高亮
[root@gitlab ~]# git config --list # 查看全局配置
user.name=clsn
user.email=admin@znix.top
color.ui=true

#生成的配置文件
[root@gitlab ~]# cat .gitconfig 
[user]
    name = clsn
    email = admin@znix.top
[color]
    ui = true

获取帮助

使用Git时需要获取帮助,有三种方法可以找到Git命令的使用手册

git help <verb>
git <verb> --help
man git-<verb>

例如,要想获得配置命令的手册,执行

git help config

posted @ 2018-03-21 21:59  云原生运维社区  阅读(175)  评论(0编辑  收藏  举报