Git Commit时出的问题,设置 Git commit的用户名和邮箱

编程入门 行业动态 更新时间:2024-10-28 02:25:23
1 $ git commit -a -m 'v6'
 2 
 3 *** Please tell me who you are.
 4 
 5 Run
 6 
 7   git config --global user.email "you@example"
 8   git config --global user.name "Your Name"
 9 
10 to set your account's default identity.
11 Omit --global to set the identity only in this repository.
12 
13 fatal: unable to auto-detect email address (got 'Administrator@WIN-20170405AQW.(
14 none)')

 遇到这种情况,可以这样:

1.全局设置(对所有git工程都有效)

    设置用户名:git config --global user.name 用户名

    设置邮箱:    git config --global user.email 邮箱

2.对特定branch(切换到工程目录下执行)

    设置用户名:git config user.name 用户名

    设置邮箱:   git config user.email 邮箱

如果这些命令不行的话;就可以尝试这个了,用这个最好是只有一个git用的这样就不会冲突;

打开Git所在位置到:Git\mingw64\etc  打开etc 里的gitconfig 文件 ,在最下面添加:

[user]

name = XXXX(用户名)

email = XXXX(邮箱)

然后就OK了。

最后改完了,可以查看修改结果:

        $ git config user.name

        $ git config user.email

更多推荐

Git Commit时出的问题,设置 Git commit的用户名和邮箱

本文发布于:2023-06-14 01:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1423157.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:用户名   邮箱   Git   Commit   commit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!