使用git config --global设置用户名和邮件问题
作者:Bryan要加油 时间:2022-02-14 11:01:08
git config --global设置用户名和邮件
安装好git后,在命令行或终端中使用下面的命令可以设置git自己的名字和电子邮件。
这是因为Git是分布式版本控制系统,所以,每个机器都必须自报家门:你的名字和Email地址。
git config --global user.name "bryan sun"
git config --global user.email "hitsjt@gmail.com"
注意:
git config命令的–global参数,用了这个参数,表示你这台机器上所有的Git仓库都会使用这个配置,当然也可以对某个仓库指定不同的用户名和Email地址。
配置好之后可以使用
git config -l
查看配置。
Git config --global user.email or user.name
本人有一段时间未将自己的项目进行代码更新,今天有所更新,在进行更新后的代码从本地库提交到远程库时,出现提示信息如下:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name" to set your account's default identity.
Omit --global to set the identity only in this repository. fatal:
unable to auto-detect email address (got 'Zero@zero.(none)')
解决该问题的方法
直接通过以下命令进行处理即可:
git config --global user.email "gitHub邮箱"
git config --global user.name "gitHub用户名"
本人电脑提示该信息的原因
由于本人电脑上的用户目录下的.gitconfig文件被我之间当作无用文件删除,所以需要重新通过git config命令来生成。
截图即为我执行上述命令后的效果,重新生成了.getconfig文件。
来源:https://bryan.blog.csdn.net/article/details/83685616
标签:git,config,global,用户名,邮件
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SecureCRT的下载、安装详细过程
2022-02-24 23:10:32
![](https://img.aspxhome.com/file/2023/0/131770_0s.png)
Linux环境MySQL服务器级优化讲解
2008-12-04 17:21:00
javascript 打印内容方法小结
2023-08-22 16:15:09
python实现五子棋游戏(pygame版)
2021-09-15 16:01:42
![](https://img.aspxhome.com/file/2023/6/65916_0s.gif)
Pytorch实现List Tensor转Tensor,reshape拼接等操作
2021-06-06 19:58:51
![](https://img.aspxhome.com/file/2023/6/80786_0s.png)
12个步骤教你理解Python装饰器
2021-01-25 18:28:56
Python MOCK SERVER moco模拟接口测试过程解析
2023-12-15 06:37:00
![](https://img.aspxhome.com/file/2023/0/101210_0s.png)
数据库疑难讲解:改善SQL Server内存管理
2009-10-29 13:30:00
[翻译]网页设计中的模式窗口
2009-05-29 18:00:00
![](https://img.aspxhome.com/file/UploadPic/20095/29/376600_124350365243zv-44s.jpg)
详解如何使用Python网络爬虫获取招聘信息
2021-09-28 06:58:17
![](https://img.aspxhome.com/file/2023/7/95277_0s.jpg)
Python实现TCP协议下的端口映射功能的脚本程序示例
2021-07-26 13:59:01
![](https://img.aspxhome.com/file/2023/2/93712_0s.png)
腾讯网QQ首页诞生的艰辛历程
2008-11-06 11:05:00
![](https://img.aspxhome.com/file/UploadPic/200811/6/01-77s.jpg)
Opencv实现倾斜图片转正示例
2022-05-02 14:28:08
![](https://img.aspxhome.com/file/2023/3/70763_0s.jpg)
thinkphp微信开发(消息加密解密)
2023-11-21 06:08:43
Python中的二叉树查找算法模块使用指南
2022-02-23 00:51:06
asp 延时 页面延迟的三种方法
2011-03-31 11:04:00
mssql server 数据库附加不上解决办法分享
2011-09-30 11:55:20
Python通过Pillow实现图片对比
2023-07-12 08:25:15
win10系统下python3安装及pip换源和使用教程
2023-07-10 19:48:40
![](https://img.aspxhome.com/file/2023/0/121040_0s.jpg)
Python字符串对齐、删除字符串不需要的内容以及格式化打印字符
2021-09-17 10:46:33