linux 环境(192.168.8.58)

1. 生成rsa key

$ ssh-keygen

如果你之前没有跑过这个文件, 接受默认选项即可。

这样你会在 ~/.ssh/下看到 id_rsa和id_rsa.pub

1.1 将id_rsa.pub的内容添加到 http://192.168.21.108:82/profile/keys中

注意由于id_rsa.pub文件较长, 可能打印成多行, 其实是一行。

2. 生成~/.ssh/config文件

3. 修改~/.ssh/config文件的权限为只能自己读写

$ chmod 600 ~/.ssh/config

4. 在~/.ssh/config中加入以下内容

Host gitlab

HostName 192.168.21.108

User git

Port 32

PubkeyAuthentication yes

RSAAuthentication yes

IdentityFile ~/.ssh/id_rsa

5. 告诉git你是谁。

git 是分布式管理系统, 没有一个统一的机构管理你的id, 你得自己告诉它

$ git config --global user.name wei.jia

$ git config --global user.email wei.jia@adchina.com

6. 让git给你点颜色看看, 否则看diff, status太累

$ git config --global color.ui true

$ git config --global color.status true

7. 在你的工作目录下执行:

git clone ssh://git@gitlab:32/data-team/sealion.git

8. 到sealion下工作

$ cd sealion

windows环境

1. 安装git

https://github.com/msysgit/msysgit/releases/download/Git-1.9.5-preview20141217/Git-1.9.5-preview20141217.exe

\\f\PD\Develop Tools\Git-1.9.5-preview20141217.exe

2. 启动git bash

3. 生成rsa key

$ ssh-keygen

接受所有默认选项即可

4. 将id_rsa.pub添加到http://192.168.21.108:82/profile/keys中

a. 用notepad打开刚创建的id_rsa.pub, Ctrl-A 选择全部, Ctrl-C复制

b. 在网页上点击 "Add SSH Key"

c. 将复制内容粘贴到key中, 然后点击“Add Key”

5. 在~/.ssh/config中加入以下内容, 如果这个文件不存在,请使用vim或notepad创建一个

Host gitlab

HostName 192.168.21.108

User git

Port 32

PubkeyAuthentication yes

RSAAuthentication yes

IdentityFile ~/.ssh/id_rsa

6. 告诉git你是谁。

git 是分布式管理系统, 没有一个统一的机构管理你的id, 你得自己告诉它

记得将命令中的贾玮的信息改成你的!!

$ git config --global user.name wei.jia

$ git config --global user.email wei.jia@adchina.com

7. 让git给你点颜色看看, 否则看diff, status太累

$ git config --global color.ui true

$ git config --global color.status true

8. 设置git bash到你的工作目录

8.1 在git bash下执行 $ cd /path/to/workdir/

8.2 或在/path/to/workdir 下执行右击 git bash

9.  git clone ssh://git@gitlab:32/data-team/sealion.git

最新文章

  1. Bitnami Redmine插件记录
  2. 常让人误解的一道js小题
  3. TIJ读书笔记06-终结清理和垃圾回收
  4. 【shell】read
  5. flex编译命令相关
  6. SQL Server 数据库定时自动备份【转】
  7. Eclipse:使用findBugs预先检测错误
  8. Android SystemUI源代码分析和修改
  9. geotrellis使用(三十)使用geotrellis读取PostGIS空间数据
  10. 新浪微博Oauth2.0授权认证及SDK、API的使用(Android)
  11. zabbix在运维方面的监控方法小结
  12. javascript 深度克隆对象
  13. libxml2的xpath检索中文
  14. windows环境下搭建Java开发环境(二):Tomcat安装和配置
  15. python生成式和生成器
  16. in packet sniffer
  17. C易忽视的基础
  18. java第四次实验报告
  19. IPython绘图和可视化---matplotlib 入门
  20. Qt 学习之路 2(66):访问网络(2)

热门文章

  1. HTML5 新功能
  2. 功能点分析法FPA笔记
  3. DataGrid列的合并
  4. github 上传或删除 文件 命令
  5. 在jsp中用EL 表达来获取表单中的参数
  6. jsoup:解析HTML用法小结
  7. iOS开发进阶-实现多线程的3种方法
  8. C# 之【线程与进程】
  9. js Dom树结构分析
  10. HDU1862EXCEL排序