git官方网站上虽然提供私有的git服务,不过是收费的。一个月最少7$。
所以为了节省人民币。自己动手建立自己的git服务端吧。
服务器环境:
cd ~/src/myproject
git init
git add *
git commit -m "Initial commit"
添加远程链接的快捷方式
git remote add origin ssh://用户名@remote.host.com/~/src/myproject.git
编辑config
vi .git/config
[branch "master"] remote = origin merge = refs/heads/master
加入以上几行
在你运行 git remote 命令时,应该会出现[remote "origin"]的配置
2、在远程服务器上建立git 服务端
克隆一个空仓库
git clone --bare myproject myproject.git touch myproject.git/git-daemon-export-ok
3、上传项目
git push origin master
4、在本地导出项目
git clone ssh://用户名@remote.host.com/~/src/myproject.git
3、接着就可以在本地进行一切git 操作了
touch README git add * git commit -m 'first commit' git push origin master
4、如果你的虚拟主机不支持git
就需要你在服务器上自己安装git,并自己在 ~/.bashrc文件中指定 path
===========================
其它的项目托管方
www.unfuddle.com
from:
http://dentharg.wordpress.com/2008/03/03/git-private-repositories-on-shared-hosting/