利用ssh建立git服务器

: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了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值