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. ( 转 )Github配置

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

  2. MyBatis的学习总结五:调用存储过程【参考】

    一.创建存储过程 存储过程的目的:统计edi_test_task 正在运行的任务和非运行的任务 CREATE DEFINER=`root`@`%` PROCEDURE `edihelper`.`SP_ ...

  3. iOS 正则表达式-判断邮箱、手机号

    判断是否是邮箱 -(BOOL)isValidateEmail:(NSString *)email { NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[ ...

  4. windows 远程连接linux服务器

    百度搜索“SSH Secure Shell Client” 并下载 2 点击Profiles选择add profiles 并添加profils名称 3 点击Profiles 填写远程linux的ip ...

  5. javascript 获取 class 样式 重新赋值class样式 为div等系列标签内更改内容

    name = document.getElementById(project_not_through_id).className;                     // 获取目标id的 cla ...

  6. 将VIM配置成强大的IDE(三)

    上一节,我们知道了,我们了解了怎么配置插件的下下载. 现在,我们就可以去DIY我们的IDE了,主要介绍taglist插件和NERDTree插件,最终的结果是: 1.安装Taglist插件. Tagli ...

  7. 使用Autofac部署IIS6.0时未能加载文件或程序集“System.Core, Version=2.0.5.0...“

    错误信息 .net4.0项目中使用autofac这个IOC容器,在部署在win2003+iis6时出现以下错误. “/”应用程序中的服务器错误. --------------------------- ...

  8. 使用token机制来验证用户的安全性-b

    登录的业务逻辑{    http:是短连接.         服务器如何判断当前用户是否登录?        // 1. 如果是即时通信类:长连接.    // 如何保证服务器跟客户端保持长连接状态? ...

  9. 转载:如何避免代码中的if嵌套

    http://top.jobbole.com/4960/ http://stackoverflow.com/questions/24430504/how-to-avoid-if-chains 在Sta ...

  10. Linux内核监控模块-1-驱动模块(LKM)开发(以一个简单的hello world程序为例)

    在上面一篇中介绍到,监控模块要做成一个驱动模块(或者说是可加载模块,LKM),动态的加载到Linux内核中.那么这篇就简单的介绍一下怎样做一个这样的驱动模块.   以简单的hello world程序为 ...