GIT 服务器自己搭建问题记录

1.服务器上安装git,过程不描述;

  1. 在某个目录下创建一个git仓库,执行git init --bare test.git;
  2. 这样就OK了,然后客户端拉取代码,不能拉取代码,多数是权限的问题,设置git组后分配目录的操作权限;
  3. 第一次push错误,insufficient permission for adding an object to repository database,权限问题,参考push error,配置仓库为共享库,git config core.sharedRepository
    if is not group or true or 1 or some mask, try running:

git config core.sharedRepository group,再分配权限,
cd /path/to/test.git
chgrp -R groupname .
chmod -R g+rwX .
find . -type d -exec chmod g+s ‘{}’ +

  1. 第一次push不上分支问题,git config ‘receive.denyCurrentBranch’ warn 配置下这个就OK;

  2. push 文件看不见问题,客服端push,服务端马上删除,remote: warning: updating the current branch,目录下执行git reset --hard,OK;

  3. 如果是初始化的工作仓库,改为共享仓库,执行这里写代码片

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值