当前位置: 首页 > linux > 正文

git gitosis could not read from remote repository

[摘要]之前一直使用gitlab来管理git代码仓库,纵然gitlab搭建相对繁琐(ruby的依赖关系我也是醉了),但是gitlab文档比较成熟,也还算容易。这两天使用了简化一些的git,使用gitosis搭建了一套git环境,虽然没有管理界面,不过几经周折终于算是能用了,这里主要是列出几个搭建和使用过程中的坑:

1. 用户公钥,一定要用.pub结尾,放到gitosis-admin/keydir目录中,push之后会在git服务器上将pubkey加到/home/git/.ssh/authorized_keys文件中。

2. 项目创建后无法push
简要列一下我创建新项目的过程:
比如创建一个新的repo,名字为:test-ios:

在push的时候有如下错误:
ERROR:gitosis.serve.main:Repository read access denied
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

找了半天原因,一开始以为是pub key的问题,后来怀疑是默认git用户的问题,不过最终发现还是是项目的权限问题:
除了gitosis-admin的repo可以push之外,对于其他的repo正确的配置应为:

而不是:

困扰一下午的问题终于解决,希望对大家在遇到此类问题搜到这篇文章的时候能够更快解决问题,减少时间的浪费。

本文固定链接: https://www.sudops.com/git-gitosis-could-not-read-from-remote-repository.html | 运维·速度

该日志由 Fisher 于2015年05月26日发表在 linux 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: git gitosis could not read from remote repository | 运维·速度
关键字: ,

git gitosis could not read from remote repository:等您坐沙发呢!

发表评论


Time limit is exhausted. Please reload the CAPTCHA.

快捷键:Ctrl+Enter