git 查看和修改配置

设置git用户名/邮箱
用户名和邮箱地址的作用
用户名和邮箱地址是本地git客户端的一个变量,不随git库而改变。
每次commit都会用用户名和邮箱纪录。
github的contributions统计就是按邮箱来统计的。

方式1
git config --global --edit
name = unknown
email = xxx@hz.ali.com

方式2
git config --global user.name author 
git config --global user.email author@corpmail.com 

修改密码

git config --global credential.helper store (输入这个命令后,以后只要在输入一次用户名密码)

如果你的公司设置的git自动获取你的账号密码,而你之前改过域密码后发现登录不上,按照下面步骤编辑密码。
在这里插入图片描述

查看用户名和邮箱地址:

$ git config user.name
$ git config user.email

使用git config --list查看已设配置

feiqianyousadeMacBook-Pro:xt_GTPU yousa$ git config --list
core.excludesfile=/Users/yousa/.gitignore_global
user.name=xx
user.email=xx
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=xxx
remote.origin.fetch=xxx
branch.master.remote=origin
branch.master.merge=refs/heads/master

修改用户名和邮箱地址:

$ git config --global user.name "username"
$ git config --global user.email "email"
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值