Git 常见问题
目录
1 unable to auto-detect email address
这个问题网上固定的解决方案是全局设置用户名和邮箱:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
其实这个问题也可以在提交时单独设置:
git -c "user.name=Your Name" -c "user.email=Your email" commit "Your commit message"
2 指定私钥文件
GIT_SSH_COMMAND='ssh -i "/data/flexcloud/vscode/.ssh/id_rsa"' git push origin master
3 are you sure you want to continue connecting
如何想要忽略这个提示,可以在终端中输入👇
GIT_SSH_COMMAND='ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no"' git push origin master