局域网 git服务

来源:互联网 发布:淘宝 企业店铺转让 编辑:程序博客网 时间:2024/05/29 23:45

1.创建新用户专门来管理仓库
useradd git
2.配置免秘钥登录
Authorized_keys中添加公钥
3.在git用户中新建仓库
要在新建的仓库中更改.git/config,添加以下的语句

[receive]        denyCurrentBranch = ignore

4.更改git-server服务器的权限,只能用git-shell

vi /etc/passwdgit:x:1001:1001:,,,:/home/git:/bin/bashgit:x:1001:1001:,,,:/home/git:/usr/bin/git-shell
原创粉丝点击