1
git环境配置
admin edited this page 2025-12-25 15:27:30 +08:00

删除旧的密钥记录 sed -i '9d' ~/.ssh/known_hosts

配置 Git 用户信息 git config --global user.name "你的姓名" git config --global user.email "你的邮箱@company.com"

配置 SSH 密钥

生成 SSH 密钥

ssh-keygen -t ed25519 -C "your_email@company.com"

查看公钥

cat ~/.ssh/id_ed25519.pub

将公钥添加到 Gerrit: Settings → SSH Keys

提交代码时安装钩子 f="$(git rev-parse --git-dir)/hooks/commit-msg" curl -o "$f"http://101.43.95.130:8082/tools/hooks/commit-msgchmod +x "$f"

git commit --amend --no-edit