68 个 登录

九库查询/Git 命令速查/git config --global user.name / user.email

git config --global user.name / user.email

设置提交作者信息

Git 命令速查 更新 2026-11-16
分组
仓库初始化
命令
git config --global user.name / user.email
示例
git config --global user.name "张三" && git config --global user.email "zhangsan@example.com"

没配就会用机器上的默认值,提交记录里作者是错的且很难事后改。公司仓库与个人仓库建议用不同 email。

数据来源:Git 官方文档整理。内容存于数据库,更新日期 2026 年 11 月 16 日。