git config :初始化配置

本文详细介绍了如何使用Git命令全局配置用户信息(用户名与邮箱),以及如何开启命令行颜色高亮显示,使Git命令操作更加直观易读。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

git config 初始化配置:

用如下三个指令可以搞定:

git config --global user.name wzb56
git config --global user.email wzb12008@sina.com
git config --global color.ui  auto


详细说明如下:

1. git global config user and email:

例如, 我的user.name 为wzb56, user.email 为wzb12008@sina.com

可以执行如下命令:

git config --global user.name wzb56
git config --global user.email wzb12008@sina.com


当git commit 的时候,使用的就是这个用户和其email,当你通过的git log时,可以看到;

配置是否生效,可以通过命令

git config --list
 查看。

2. git 命令行显示呈现color 高亮:如果git diff/branch/status/log 等

可以通过全局的一个命令:

git config --global color.ui auto

其等效于以下所有指令:
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color interactive auto

设置之后你的git ui的命令行就更漂亮了(有了高亮机制)。










1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值