git与ssh配置方法及注意事项
ed25519密钥ssh-keygen -t ed25519 -C YOUR_EMAILuse your real email value instead of YOUR_EMAIL
将私钥添加到身份验证代理
ssh-add
~/.ssh/id_ed25519.pub的文本添加到gerrit或git用户配置的SSH keys中cat ~/.ssh/id_ed25519.pubsetting buttonSSH Public Keys buttonAdd key button~/.ssh/config配置文件中指定认证选项,明确指定认证文件(不是必须的)Host your.gerrit.host
IdentityFile ~/.ssh/id_ed25519
~/.ssh/config配置文件中指定客户端接受RSA密钥(不推荐)PubkeyAcceptedKeyTypes +ssh-rsa
如
Host *
ServerAliveInterval 120
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_rsa
PubkeyAcceptedKeyTypes +ssh-rsa
verify whether the ssh config is ok
ssh -p 29418 USER@SERVER_IP
or add -vv option to see detailed information.
ssh -vv -p 29418 USER@SERVER_IP
config git
git config --global user.name YOUR_USERNAME
git config --global user.email YOUR_EMAIL
use your real github or gerrit username instead of YOUR_USERNAME, No square brackets
use your real email value instead of YOUR_EMAIL, No square brackets
git config --global core.editor vim
git config --global commit.template ~/.git.commit.template.txt
edit commit template file, eg: ~/.git.commit.template.txt
[id][platform][module] short message
Release note:
-problem:
-solution:
-author:
-reviewer:
Test:
1.
2.