在使用 Git 时,我们需要先设置 Git 的用户名和邮箱地址,以便在提交代码时进行身份验证和追踪。设置方法如下:
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"
其中,Your Name
为你的用户名,your_email@example.com
为你的邮箱地址。
git config --global user.name
git config --global user.email
如果想要修改已经设置好的用户名和邮箱地址,可以重新执行上述命令即可。
需要注意的是,为了避免出现身份验证失败的情况,建议使用真实的邮箱地址。