http://blog.csdn.net/wave_1102/article/details/47779401
开始直接用 yum install 安装 git,后来发现版本太低,就 yum remove 掉了。
整个过程也是神烦各种权限,包括后来使用 gitosis,网上教程基本上千篇一律,抄袭不带引用,不带改的。
整理下自己的安装心得。
正文开始..
首先下载 tar 包,因为我比较喜欢新的版本,自己选择合适的 tar 版本包就好。
Git官网:https://git-scm.com/download/linux
下载完上传到自己的 Linux 服务器,
1 tar -xzvf git-2.9.4.tar.gz
进入解压完的目录
1 cd git-2.9.4
我这边直接开始编译了,然后报错说找不到 xxx.h 的文件,寻思着应该是没有那些 gcc 什么的组件,百度一番,后来找到的链接不是第一次看到的,内容都是大差不离的。这边直接截个图。
然后开始编译
根据历来 linux 的权限管理以及网上的各种云云,我们这里新建一个用户 git
1 useradd git
密码自己设置
1 passwd git
安装完 git 可能需要设置一下环境变量。自行百度。
现在,来测试一下。
新建一个仓库。切换到 git 的用户主目录下,以 root 身份执行。
1 git init --bare HelloWorld.git
更改目录权限给至 git
切换到 win ,尝试拉这个空仓库
gitosis 安装配置好突然这么一来还不让我拉了!!
这边我就不去搞他了。
自己尝试一下应该是没问题的。
然后处于安全考虑的禁用 shell 登录的自己玩去吧!再见!