美文网首页
Git Daemon

Git Daemon

作者: 啦啦啦你猜我是谁 | 来源:发表于2018-08-29 17:07 被阅读0次

当项目组来新成员shadow时,新成员可能对我们的github上的repo没有权限,为了让新成员快速的接触项目代码,我们该怎么做呢?怎么让新成员快速的能clone到我们的repo呢?

我们可以使用git daemon命令

Share Read Only Access

  • server 端

你需要在你的terminal中运行如下命令:


git daemon --export-all --verbose --base-path=.

--export-all : share “–base-path” 下所有的repo

--base-path=. : 定义了folder为当前目录

--verbose: 任何操作都会给当前repo通知

还可以在上一条command后面添加其他参数:

--informative-errors: 给client提供简洁的错误信息

--reuseaddr :允许快速重启server

  • client端

git clone git://[server端IP 地址]/[Repo Name]

同理pull 代码时:


git pull git://[server端IP 地址]/

Share Push Access


git daemon --export-all --verbose --base-path=.  --enable=receive-pack

--enable=receive-pack :允许client端向server端push代码

相关文章

网友评论

      本文标题:Git Daemon

      本文链接:https://www.haomeiwen.com/subject/kzekwftx.html