:git_server => "10.0.0.9"
:git_repo => "yyj@10.0.0.9:/home/yyj/git-repo/headshot"
:git_client => "my_home_machine"
:git_client_project => "/home/yyj/store0/projects/headshot"
第一步:初始化git repo
在git_server上
$ cd /home/yyj
$ mkdir git-repo
$ cd git-repo
$git init --bare headshot
Initialized empty Git repository in /home/yyj/git-repo/headshot/.git/
当一个 repository 初始化后, 里面什么也没有。我们需要建立个 master branch,才能被正常 clone 到其他地方。
第二步:
在git_client
$ cd /home/yyj/store0/projects/headshot
$ git init
Initialized empty Git repository in /home/yyj/store0/projects/headshot/.git/
git remote add origin yyj@10.0.0.9:/home/yyj/git-repo/headshot
$ git add .
$ git commit -m "headshot的版本管理"
$ git push
#输入密码
好了 项目建立好 并且已经放到git的管理下了
如果其它人要加入进来开发
直接 git clone yyj@10.0.0.9:/home/yyj/git-repo/headshot 就ok了