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

git_share的更多相关文章

随机推荐

  1. <>跟!=

    这两个是没有区别的,都是不等于

  2. 微信Demo导入遇到的问题

    最近做支付宝和微信接入自己APP工程的功能,遇到了一些问题,跟大家分享: 这里先说Android开发微信支付接入. 首先根据官方文档进行,对比支付宝的官方文档,微信部分更显得“摘要”一些. 导入后自行 ...

  3. mvc5 + ef6 + autofac搭建项目(repository+uow)(一)

    直奔主题了,不那么啰嗦. 整体框架的参考来源是  O# 的框架,在此感谢锋哥一直以来的开源,让我们有的学 如下图: (图一) 一下分三个步骤说明,分别为 dbContext,repository,uo ...

  4. 如何使用event 10049分析定位library cache lock and library cache pin

    Oracle Library Cache 的 lock 与 pin 说明 一. 相关的基本概念 之前整理了一篇blog,讲了Library Cache 的机制,参考: Oracle Library c ...

  5. CSS Padding(填充)

    CSS Padding(填充)属性定义元素边框与元素内容之间的空间. Padding(填充) 当元素的 Padding(填充)(内边距)被清除时,所"释放"的区域将会受到元素背景颜 ...

  6. [Introduction to programming in Java 笔记] 1.3.8 Gambler's ruin simulation 赌徒破产模拟

    赌徒赢得机会有多大? public class Gambler { public static void main(String[] args) { // Run T experiments that ...

  7. web版扫雷小游戏(三)

    ~~~接上篇,上篇介绍了游戏实现过程中第一个比较繁琐的地方,现在展现在玩家面前的是一个有血有肉的棋盘,从某种意义上说玩家已经可以开始游戏了,但是不够人性化,玩家只能一个一个节点的点开,然后判断,然后标 ...

  8. jQuery获取Select选择的Text和 Value

    jQuery获取Select选择的Text和Value:语法解释:1. $("#select_id").change(function(){//code...});   //为Se ...

  9. Shortcut Collapse project or projects in the Solution Explorer Microsoft Visual Studio 2008

    The standard windows keyboard shortcuts for expanding and collapsing treeviews are: Numeric Keypad * ...

  10. sql数据库优化技巧汇总

    (转)SQL 优化原则 一.问题的提出 在应用系统开发初期,由于开发数据库数据比较少,对于查询SQL语句,复杂视图的的编写等体会不出SQL语句各种写法的性能优劣,但是如果将应用系统提交实际应用后,随着 ...