要设置Git的用户名和邮箱,可以使用以下命令:

  1. 设置全局用户名:

    git config --global user.name "Your Username"
    
  2. 设置全局邮箱:

    git config --global user.email "your_email@example.com"
    

请记住,将 "Your Username" 替换为您的用户名,"your_email@example.com" 替换为您的邮箱地址。

如果您想为特定的仓库设置不同的用户名和邮箱,可以在不使用 --global 参数的情况下运行相同的命令,并在特定的仓库目录下执行。

您可以使用以下命令检查您的用户名和邮箱是否已正确设置:

git config user.name
git config user.email
git 设置用户名和邮箱

原文地址: https://www.cveoy.top/t/topic/h1ql 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录