Git服务器安装
来源:互联网 发布:contact java 编辑:程序博客网 时间:2024/06/06 21:45
git是一个不错的版本管理的工具。现在自己在搞一个简单的应用程序开发,想使用git来进行管理。在Google了配置文档后,还是受了N多的挫折。某些文档质量不高,浪费了好多时间......
好,切入正题:
安装必要的git工具
#apt-get install git git-core
安装好了以后,进行设置
1. 创建一个git目录
#mkdir /git
#cd /git/
#mkdir myproject
2. 创建一个空的git仓库
#git-init-db
3. 创建工程的文件
# echo "My test project" > test.txt
* 此步很重要,如果要在远程clone这个project, 这个project必须是非空的,否则会失败。
4. 使用git命令添加并提交新的文件
#git-add test.txt
#git-commit -m "Init"
至此,本地的git 仓库就创建好了。想要在远程clone这个project,还需要使用git-daemon
5. 安装git-daemon-run. git-daemon-run实际是一个脚本管理工具,用来启动git-daemon.
#apt-get install git-daemon
6. 配置git-daemon-run
#vi /etc/sv/git-daemon/run
可以看到
#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec chpst -m64000000 /
git-daemon --verbose --base-path=/var/cache /var/cache/git
将最后一句的git-daemon修改为
git-daemon --verbose --export-all --base-path=/git/
* 这里,我加上了一个--export-all.看下man手册就可以知道,使用该选项后,在git仓库中就不必创建git-daemon-export-ok文件。如果不使用该选项,则在第4步还需要创建该文件,即
#touch git-daemon-export-ok
7.重启系统
由于小弟还不知道如何使用git-daemon-run工具重启git-daemon,干脆重启下系统
8. 从client导出server(192.168.35.69)上的myproject
git-clone git://192.168.35.69/myproject
- Git服务器安装
- GIT服务器的安装
- 安装git服务器
- 安装git服务器
- Ubuntu 安装git服务器
- Ubuntu安装git服务器
- 安装Git 服务器
- 安装git服务器
- centos安装git服务器
- 安装git服务器
- git服务器安装 windows
- git服务器安装
- CentOS 安装Git 服务器
- centos安装git服务器
- ubuntu16安装git服务器
- Git服务器安装 windows
- Ubuntun 安装git服务器
- Git服务器Gitosis安装设置
- [转]S3C44B0X引导程序中伪指令详解
- spring 管理DAO
- .NET第二章
- JS操作表格
- 使用git进行版本管理
- Git服务器安装
- 教你如何快速编译MDD层代码
- Visual Studio.net 2003安装提示重启问题
- MySQL问题贴2:Delphi2007安装ZeoLib组件相关问题解决
- 树
- 人生励志
- 修改后的multselect的jquery获得多选
- C/C++数组名与指针区别
- 幸福是什么?