git linux 多工程部署及git默认端口更改

>> ssh-keygen -t rsa -C "your_email@youremail.com"

print  Generating public/private rsa key pair.

>> Enter file in which to save the key (/root/.ssh/id_rsa): /root/.ssh/id_rsa_new

然后一路回车到底

>> cat>~/.ssh/config
# 映射一个别名
host github
hostname github.com
# 有端口需求可以加上端口映射
# port 22022
>> ctrl+D 
 
#完整的一个config 配置文件内容
host github
    hostname github.com
    IdentityFile ~/.ssh/id_rsa
    # 端口
    #port 22022

Host config
  HostName github.com
  IdentityFile ~/.ssh/id_rsa_config

>> ssh-agent bash

>> ssh-add ~/.ssh/id_rsa_new

 

这样就完成了整体的配置

 

克隆仓库的时候这样使用

>> git clone  git@config:xxx/xxx.git  

 

 



posted @ 2016-12-07 10:59  夜未央丿  阅读(792)  评论(0编辑  收藏  举报