Git   发布时间:2022-05-05  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了通过git bash设置公钥大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

<table class="text"><tr class="li1">
<td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

用户名和邮箱:
$ git config --global user.name "superGG1990"
 
$ git config --global user.email "superGG1990@163.com"   注意:(引号内请输入你自己设置的名字,和你自己的邮箱)此用户名和邮箱是git提交代码时用来显示你身份和联系方式的,并不是github用户名和邮箱
git使用ssh密钥
 
git支持https和git两种传输协议,github分享链接时会有两种协议可选:
git使用https协议,每次pull,push都会提示要输入密码,使用git协议,然后使用ssh密钥,这样免去每次都输密码的麻烦
初次使用git的用户要使用git协议大概需要三个步骤:
一、生成密钥对
二、设置远程仓库(本文以github为例)上的公钥
 
$ ssh-keygen -t rsa -C "your_email@youremail.com"
Creates a new ssh key using the provided email # Generating public/private rsa key pair.
 
Enter file in which to save the key (/home/you/.ssh/id_rsa):
直接按Enter就行。然后,会提示你输入密码,如下(建议输一个,安全一点,当然不输也行,应该不会有人闲的无聊冒充你去修改你的代码):
 
Enter same passphrase again: [Type passphrase again]
完了之后,大概是这样:
 
Your public key has been saved in /home/you/.ssh/id_rsa.pub.
The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@youremail.com
 
二、添加公钥到你的远程仓库(github)
 
参网址:https://www.cnblogs.com/superGG1990/p/6844952.html
 

大佬总结

以上是大佬教程为你收集整理的通过git bash设置公钥全部内容,希望文章能够帮你解决通过git bash设置公钥所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: