标签:
网上大牛都说的是安装gitolite要建git用户,我看完全没必要,毕竟用户拿到私钥也未必能登录服务器吧。。。下面我们就用root用户来安装gitolite,并且配置版本库文件保存路径。。
[root@servertwiki /data/tmp]# git clone git://github.com/sitaramc/gitolite Cloning into ‘gitolite‘... remote: Counting objects: 8682, done. remote: Total 8682 (delta 0), reused 0 (delta 0) Receiving objects: 100% (8682/8682), 3.61 MiB | 533.00 KiB/s, done. Resolving deltas: 100% (4917/4917), done. Checking connectivity... done.
[git@servertwiki /data/gitolite]$ mkdir bin [git@servertwiki /data/tmp/gitolite]$ ./install -to /data/gitolite/bin [git@servertwiki /data/gitolite/bin]$ ./gitolite setup -pk /root/.ssh/GitAdmin.pub Initialized empty Git repository in /data/gitolite/repositories/gitolite-admin.git/ Initialized empty Git repository in /data/gitolite/repositories/testing.git/ WARNING: /home/forilen/.ssh/authorized_keys missing; creating a new one (this is normal on a brand new install)
root@192.168.100.252:/data/forilen/git# git clone forilen@192.168.100.245:gitolite-admin Initialized empty Git repository in /data/forilen/git/gitolite-admin/.git/ WARNING: Can‘t exec "git": No such file or directory at /home/forilen/bin/lib/Gitolite/Common.pm line 146, <DATA> line 1. fatal: The remote end hung up unexpectedly root@192.168.100.252:/data/forilen/git# git clone forilen@192.168.100.245:gitolite-admin Initialized empty Git repository in /data/forilen/git/gitolite-admin/.git/ remote: Counting objects: 6, done. remote: Compressing objects: 100% (4/4), done. remote: Total 6 (delta 0), reused 0 (delta 0) Receiving objects: 100% (6/6), done. [root@servertwiki bin]# ln -sf /data/usr/git/bin/git git [root@servertwiki bin]# which git /usr/bin/git #git在git服务器上的唯一路径 [forilen@servertwiki bin]$ ./gitolite setup -pk ../.ssh/key252.pub Initialized empty Git repository in /home/forilen/repositories/gitolite-admin.git/ Initialized empty Git repository in /home/forilen/repositories/testing.git/ WARNING: /home/forilen/.ssh/authorized_keys missing; creating a new one (this is normal on a brand new install) root@192.168.100.252:/data/forilen/git# git clone forilen@192.168.100.245:gitolite-admin Initialized empty Git repository in /data/forilen/git/gitolite-admin/.git/ remote: Counting objects: 6, done. remote: Compressing objects: 100% (4/4), done. remote: Total 6 (delta 0), reused 0 (delta 0) Receiving objects: 100% (6/6), done. root@192.168.100.252:/data/forilen/git# ls gitolite-admin root@192.168.100.252:/data/forilen/git# tree . . └── gitolite-admin ├── conf │ └── gitolite.conf └── keydir └── key252.pub 3 directories, 2 files
6. Git客户端配置
6.1 Windows上git客户端软件安装
内网资源:ftp://192.168.100.252/tools/
mysysGit:默认安装,点next下去
TortoiseGit:默认安装,点next下去
6.2 密钥对生成及配置
6.2.1 在启动栏找到gitbash
6.2.2 运行gitbash,生成密钥对
6.2.3 启动栏启动Puttygen
6.2.6 提交公钥给git服务器管理员
6.2.7 生成的id_rsa.pub重命名为 英文名.pub
7. 本地clone版本库
确认管理员把权限和帐号都配置完成后,才能导出版本库到本地
7.1 本地建立空目录,右键 git clone
7.2 选择导出目录
7.3 Git相关操作
8. 常见问题解决方法
8.1 本地密钥管理机
8.1 打开导入新的密钥
9. 其他:
hook: http://www.tuicool.com/articles/Z7by2y
10. 参考文献:
标签:
原文地址:http://www.cnblogs.com/forilen/p/4241055.html