Git config 配置及SSH key生成
来源:互联网 发布:跪台办 知乎 编辑:程序博客网 时间:2024/06/06 04:18
今天又有人问我这个问题下面我就把如何配置自己git的全局信息以及SSH key的生成方式写下来以免重复工作。
首先你需要的是这两行命令(当然不配置也是可以的)
git config –global user.name “XXX”
git config –global user.email XX@example.com(your email address)
检查SSH keys是否存在
输入下面的命令,如果有文件id_rsa.pub 或 id_dsa.pub,则直接进入步骤3将SSH key添加到GitHub中,否则进入第二步生成SSH key
ls -al ~/.ssh( Lists the files in your .ssh directory, if they exist)生成新的ssh key
在命令行中输入ssh-keygen -t rsa -C “your_email@example.com”
默认会在相应路径下(/your_home_path)生成id_rsa和id_rsa.pub两个文件,如下面代码所示
ssh-keygen -t rsa -C “your_email@example.com”
( Creates a new ssh key using the provided emailGenerating public/private rsa key pair.Enter file in which to save the key (/your_home_path/.ssh/id_rsa)将ssh key添加到GitHub中
用自己喜欢的文本编辑器打开id_rsa.pub文件,里面的信息即为SSH key,将这些信息复制到GitHub的Add
SSH key页面即可
不同的操作系统,均有一些命令,直接将SSH key从文件拷贝到粘贴板中,如下:
mac
pbcopy < ~/.ssh/id_rsa.pub
( Copies the contents of the id_rsa.pub file to your clipboard)
windows
clip < ~/.ssh/id_rsa.pub
(Copies the contents of the id_rsa.pub file to your clipboard)
Linux
sudo apt-get install xclip
( Downloads and installs xclip. If you don’t haveapt-get
, you mightneed to use another installer (likeyum
))
xclip -sel clip < ~/.ssh/id_rsa.pub( Copies the contents of the id_rsa.pub file to your clipboard)
- Git config 配置及SSH key生成
- 配置Git及生成SSH Key
- git ssh key 生成及配置
- github的ssh key生成及git客户端的配置
- git 生成ssh key及使用过程
- git ssh key生成和配置
- Git使用手册:使用SSH Key及配置SSH key公钥
- 生成ssh key及配置多个ssh key
- git生成ssh key
- git 生成SSH KEY
- Git SSH Key生成
- git生成ssh key
- GIT 生成 SSH key
- git ssh key 生成
- Git SSH Key 生成
- git --- SSH Key生成
- git ssh key 生成
- GIT配置SSH key
- maven项目中找不到Maven Dependencies解决办法
- 我的 或 个人中心 布局文件
- 打包aar不包含依赖jar文件
- Oracle clusterware
- Linux: Check version info
- Git config 配置及SSH key生成
- 如何成为一个优秀的产品经理
- 在Android 5.0中使用JobScheduler
- uploadify3.2.1 + spring mvc 上传
- wap简单的卡片层叠布局 滑动
- Rsa加密,公钥私钥的用法(转载的好文-望能帮到别人)
- tomcat 防xss 的一种实现
- RxJava简介及在androidstudio中引入RxAndroid
- 多线程点断下载