mac 布置 git仓库服务器

创建管理员账户 例如:git

使用git账户登录

开启git账户的远程登陆

创建仓库文件夹

sudo git --bare init

更改配置文件

cd /Users/userName/projects

sudo vim .git/config 

vim操作教程

~1,进入vim后如果你没有在键盘上按过其它按键的话。可以先按下键盘上shift+g;(会让光标移动到文本的最后一行的行头。)

~2,按一下o键;(在当前行下面插入一行并进入输入模式)

~3,添加

 

[receive]
    denyCurrentBranch = ignore

更改仓库文件夹的目录权限

cd .. && sudo chmod -R 777 projects

连接服务器

git clone git_user@192.168.1.XX:testgit test

原文地址:https://www.cnblogs.com/jt-huang/p/5864204.html