1. 安装:官网傻瓜式安装

2.密钥的生成:为了不让不想干的人提交代码,所以需要一个密钥

执行这个命令 :

ssh-keygen -t rsa -C "邮箱地址"

然后一直回车键回车键就可以

在第二个蓝色的框哪里就是出现密钥的存储位置

然后,登陆github,点击settings(设置)

ssh and ...

点击添加

点击add shh key。这样本地和github建立了通信基础

那么,如何配置多个呢?先配置一个。

1.  cd ~/.ssh

2.vim config

3.添加Host/HostName/User/IdentityFile  四项

Host github.com

HostName github.com

User peixm

IdentityFile  /Users/newcomer/.ssh/id_rsa(绝对路径)

以下是文件的样子:

但是多个呢?首先将id_rsa改名字,比如改成id_rsa_mine。 (mv id_rsa id_rsa_mine)

然后在进行各种的add shh key,然后将id_rsa改名成 比如 id_rsa_公司

文件的样子就是

#个人git

Host github.com

HostName github.com

User peixm

IdentityFile  /Users/newcomer/.ssh/id_rsa_mine

#公司git

Host 自己公司的名字

HostName 自己公司的地址比如(github.geo.apple.com)

User peixm

IdentityFile  /Users/newcomer/.ssh/id_rsa_公司



1. github配置的更多相关文章

  1. window下配置SSH连接GitHub、GitHub配置ssh key

    window下配置SSH连接GitHub.GitHub配置ssh key   此经验分两部分: 第一部分介绍:在windows下通过msysGit(Git for windows.Git Bash)配 ...

  2. 跟我学SpringCloud | 第六篇:Spring Cloud Config Github配置中心

    SpringCloud系列教程 | 第六篇:Spring Cloud Config Github配置中心 Springboot: 2.1.6.RELEASE SpringCloud: Greenwic ...

  3. github配置及使用

    安装git 对于linux系统,不同发行版本的安装方法不一样,请参考https://git-scm.com/download/linux.以ubuntu为例: sudo add-apt-reposit ...

  4. github配置和git学习

    参考:http://www.eoeandroid.com/thread-272837-1-1.html http://blog.csdn.net/hcbbt/article/details/11651 ...

  5. ( 转 )Github配置

    以下转自 http://liuzhijun.iteye.com/blog/1457207 有问题请联系我删除. -----———————————————————————— 如果你的代码不知道放哪里好, ...

  6. window下配置SSH连接GitHub、GitHub配置ssh key(转)

    转自:http://jingyan.baidu.com/article/a65957f4e91ccf24e77f9b11.html 此经验分两部分: 第一部分介绍:在windows下通过msysGit ...

  7. ubuntu 14.0 下github 配置

    一:创建Repositories 1:首先在github下创建一个帐号.这个不用多说,然后创建一个Repositories. 2:然后在ubuntu下安装git相关的东东: 1 sudo apt-ge ...

  8. windows中使用Git工具连接GitHub(配置篇)

    Git在源码管理领域目前占很大的比重了,而且开源的项目很多都转到GitHub上面了.例如:jQuery, reddit, Sparkle, curl, Ruby on Rails, node.js,  ...

  9. 同一台电脑使用 gitlab 和 github 配置

    Git 客户端与服务器端的通信支持多种协议,ssh 最常用.ssh的公钥登录流程,用户将自己的公钥存储在远程主机,登录时,远程主机会向用户发送一条消息,用户用自己的私钥加密后,再发给服务器.远程主机用 ...

  10. github配置ssh密钥的方法

    配置用户名和邮箱 初次安装git需要配置用户名和邮箱,否则git会提示:please tell me who you are. 你需要运行命令来配置你的用户名和邮箱: $ git config --g ...

随机推荐

  1. mktemp -t -d用法

    mktemp命令用于建立暂存文件或者文件夹,帮助文档如下: Usage: mktemp [OPTION]... [TEMPLATE] Create a temporary file or direct ...

  2. layer弹层基本参数初尝试

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  3. oracle数据库备份和恢复

    参考地址:https://www.cnblogs.com/1175429393wljblog/p/9529334.html Oracle数据导入导出imp/exp 在cmd的dos命令提示符下执行,而 ...

  4. Vue之动态绑定CSS样式

    demo.html <!DOCTYPE html> <html lang="en" xmlns:v-bind="http://www.w3.org/19 ...

  5. Create an Azure SQL database in the Azure portal

    Create a SQL database An Azure SQL database is created with a defined set of compute and storage res ...

  6. HackerRank beautiful string

    问题 https://vjudge.net/problem/HackerRank-beautiful-string 给一个字符串S,可以任意取走S中的两个字符从而得到另外一个字符串P,求有多少种不同的 ...

  7. winFormToMysql&&几个控件的数据绑定

    运行图: 代码: private void button1_Click(object sender, EventArgs e) { string str = "database=csharp ...

  8. 使用Golang打造自己的http服务器 1.0版本

    package main import ( "io/ioutil" "net/http" "os" ) func main() { args ...

  9. linux拷贝多个目录下的文件到同一个目录

    拷贝a目录下的a.txt和b目录下的b.txt到c目录 cp -a \ /root/a/a.txt \ /root/b/b.txt \ /root/c/

  10. 使用JSch远程执行shell命令

    package com.nihaorz.jsch; import com.jcraft.jsch.Channel; import com.jcraft.jsch.ChannelExec; import ...