git生成公钥public key并添加SSH key。git乌龟gerrit下推送git【server sent :publickey】

 一、key

windows git 安装程序下载过慢。可以到可腾讯软件中心下载

网址链接

码云链接:http://git.mydoc.io/?t=180845#text_180845

博客链接:

方式一:https://blog.csdn.net/xb12369/article/details/78682018

方式二:https://www.cnblogs.com/s313139232/p/10178378.html

命令备份:

cd ~/.ssh/

git config --global user.name "123"

git config --global user.email "123@qq.com"

ssh-keygen -t rsa -C "123@qq.com"

配置ssh(id_rsa.pub文件为公钥,打开复制)

introduction copy:

创建 SSH Key。在用户主目录下,看看有没有.ssh目录,如果有,再看看这个目录下有没有id_rsaid_rsa.pub这两个文件,如果已经有了,可直接跳到下一步。如果没有,打开 Shell(Windows下打开Git Bash),创建SSH Key:

你需要把邮件地址换成你自己的邮件地址,然后一路回车,使用默认值即可。

如果一切顺利的话,可以在用户主目录里找到.ssh目录,里面有id_rsaid_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥,可以放心地告诉任何人。

然后登录GitHub(或者其它Git代码托管平台),打开Account settingsSSH Keys页面,点Add SSH Key,填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容。

为什么GitHub需要SSH Key呢?因为GitHub需要识别出你推送的提交确实是你推送的,而不是别人冒充的,而Git支持SSH协议,所以GitHub只要知道了你的公钥,就可以确认只有你自己才能推送。

当然,GitHub允许你添加多个Key。假定你有若干电脑,你一会儿在公司提交,一会儿在家里提交,只要把每台电脑的Key都添加到GitHub,就可以在每台电脑上往GitHub推送了。

记住密码

永久记住密码
git config --global credential.helper store
会在用户主目录的.gitconfig文件中生成下面的配置。
[credential]
helper = store

说明链接

https://blog.csdn.net/Brouce__Lee/article/details/81872040

二、小乌龟

链接:

小乌龟gerrit配置篇:   https://www.cnblogs.com/zndxall/p/8609734.html

关于refs/for/和refs/heads/:   https://www.cnblogs.com/0616--ataozhijia/p/4165052.html

Git使用之Windows环境下配置https://www.cnblogs.com/xishuai/p/3590434.html

三、重新生成chang-id

http://www.360doc.com/content/17/0615/18/10058718_663431721.shtml

四、windows用户凭据

https://blog.csdn.net/liuskyter/article/details/89210077

原文地址:https://www.cnblogs.com/foolash/p/11769754.html