GIT粗游记(一)
2014-02-28 14:23
162 查看
用SVN已渐显疲感,于是今天突来兴致便拿GIT一试,粗游一番。按照个人习惯,本编便以搭建GIT服务器为起点,逐篇游玩GIT各处亮点。
服务器:CentOS 6.3
使用SSH远程登录服务器后,安装GIT相关依赖包:
[root@economy ~]# yum install curl curl-devel zlib-devel perl perl-devel gettext-devel expat-devel openssl-devel -y
以下将介绍两种安装方式(看客自行二选一):
①、使用命令“yum”安装默认镜像版本(一般安装版本较低)
[root@economy ~]# yum install git ... [root@economy ~]# git --version git version 1.7.1
②、通过源码编译安装最新版本
(地址不能翻墙可下载ZIP包:https://github.com/git/git/archive/master.zip)
[root@economy ~]# cd /usr/src [root@economy src]# wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz ... [root@economy src]# ls git-1.9.0.tar.gz [root@economy src]# tar -zxvf git-1.9.0.tar.gz ... [root@economy src]# cd git-1.9.0 [root@economy git-1.9.0]# make configure [root@economy git-1.9.0]# ./configure --prefix=/usr/local ... [root@economy git-1.9.0]# make all ... [root@economy git-1.9.0]# make install ... [root@economy git-1.9.0]# git --version git version 1.9.0
安装GITOLITE相关依赖包:
[root@economy git-1.9.0]# yum install perl-Time-HiRes -y
创建GIT用户:
[root@economy git-1.9.0]# useradd git [root@economy git-1.9.0]# passwd git ... [root@economy git-1.9.0]# su - git [git@economy ~]$
通过GIT安装最新版本:
[git@economy ~]$ git clone git://github.com/sitaramc/gitolite ... [git@economy ~]$ mkdir bin [git@economy ~]$ ls bin gitolite [git@economy ~]$ ./gitolite/install -to ~/bin/ [git@economy ~]$ ls bin commands gitolite gitolite-shell lib syntactic-sugar triggers VERSION VREF
安装管理员SSH秘钥(管理员xxx@xxx.xxx看客自行修改):
[git@economy ~]$ ssh-keygen -C xxx@xxx.xxx Generating public/private rsa key pair. Enter file in which to save the key (/home/git/.ssh/id_rsa): xxx@xxx.xxx Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in xxx@xxx.xxx. Your public key has been saved in <span style="font-family: Arial, Helvetica, sans-serif;">xxx@xxx.xxx</span><span style="font-family: Arial, Helvetica, sans-serif;">.pub.</span> ... [git@economy ~]$ ls bin gitolite xxx@xxx.xxx xxx@xxx.xxx.pub [git@economy ~]$ gitolite setup -pk xxx@xxx.xxx.pub ... [git@economy ~]$ ls .ssh authorized_keys
服务器的搭建可以说就此完成,下回粗游GITOLITE如何管理GIT服务器。
相关文章推荐
- Eclipse上GIT插件EGIT使用手册之六_远程GIT仓库
- Dropbox做私有Git服务器
- git 安装
- 关于Git中的一些常用的命令
- 三分钟教你学Git(十五) - 搜索
- 代码管理git总结
- Git详解之二 Git基础
- git 命令大全
- Phpstorm配置git版本控制器
- git入门(2.基础)
- Eclipse中怎么清除Git用户名和密码
- git 常用命令
- git 撤回上一次commit中某一个不想添加的文件
- git stash和git stash pop
- eclipse中git版本回退。
- 解决Git 换行符自动转换问题的方法
- eclipse添加git功能
- Xcode连接git@osc
- Git 撤销修改
- 15分钟学会使用Git和远程代码库