git常用命令
配置作者信息和电子邮箱
oor@DESKTOP-HPU1HI7 MINGW64 ~/Desktop $ git config --global user.name "Alce" oor@DESKTOP-HPU1HI7 MINGW64 ~/Desktop $ git config --global user.email o.or@qq.com
三次回车,察看密钥
oor@DESKTOP-HPU1HI7 MINGW64 ~/Desktop $ ssh-keygen -t rsa -C "o.or@qq.com" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/oor/.ssh/id_rsa): /c/Users/oor/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/oor/.ssh/id_rsa. Your public key has been saved in /c/Users/oor/.ssh/id_rsa.pub. The key fingerprint is: SHA256:8qYB+B8XUcpevO8IUg8s/xU4LH5xVx8ZL+L3MLeCXH8 o.or@qq.com The key's randomart image is: +---[RSA 2048]----+ | . . | | . + +| | + o . .oo| | . o + + . oo| | . . o S * +.= o| | . . B =.=o+.=.| | . + B ooo. oE| | . B + + . .| | o o . | +----[SHA256]-----+ oor@DESKTOP-HPU1HI7 MINGW64 ~/Desktop
查看完整密钥命令
$ cat ~/.ssh/id_rsa.pub
一个公钥只能给一个仓库
gitee中添加新的公钥
在git中查看码云的公钥是否添加成功
oor@DESKTOP-HPU1HI7 MINGW64 ~/Desktop $ ssh -T git@gitee.com Warning: Permanently added the ECDSA host key for IP address '212.64.62.183' to the list of known hosts. Hi Alec! You've successfully authenticated, but GITEE.COM does not provide shell access. oor@DESKTOP-HPU1HI7 MINGW64 ~/Desktop
以后使用git客户端给码云推送的时候就不用使用账号和密码了