git服务器 ssh协议

搭建的gogs 还有gitea, 新建的仓库都会有下面这个
git remote add origin [email protected]:sleepm/sample.git
但是push的时候又会有以报错
fatal: ‘sleepm/sample.git’ does not appear to be a git repository
fatal: Could not read from remote repository.
意思大概是请求的路径并不是一个代码仓库
好好想一想,冒号后面的是路径,因为用的root用户,所以,绝对路径是
/root/sleepm/sample
但git服务器配置的repository路径却是另外一个,比如
[repository]
ROOT = /root/gitea-repository/
仓库都在那个目录里….
所以,下面这样写就可以正常的push了
git remote add origin [email protected]:gitea-repositories/sleepm/sample.git

如果不想加那么长,可以在配置里把路径改成/root,然后重启gitea
再把原来的仓库移动到root下面,就好了

缺点就是….root下面会有很多目录,用户越多,目录越多…
挖个坑,git服务器的git协议
https://github.com/git/git/blob/master/Documentation/git-daemon.txt

发布者

gt

QQ: 1520667045 一个名叫坏人的博客,他很想成为WEB攻城狮,因为他认为每个前端开发者的审美观都是很挑的……

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据