繁体   English   中英

git over ssh第二个用户无法克隆

[英]git over ssh second user can't clone

我们是两个开发人员在一个项目上工作,我在服务器(ArchLinux)上设置了一个git仓库,我们两个人都可以通过ssh进行访问。 git存储库是通过以下方式创建的:

mkdir project
touch project/readme.txt

git init project
cd projet
git add .
git commit -m 'initial commit'
git push origin master
cd ..
git clone --bare project.git

cd project.git
git config core.sharedRepository true

cd ..
setfacl -R -m g:<group name>:rwX project.git
find gitrepo -type d | xargs setfacl -R -m d:g:<group name>:rwX

我们的组名为dev,两个用户都在该组中(在/ etc / groups中选中)

在第二台机器上(可以是我的机器,也可以是第二个开发者的机器),我们以这种方式克隆存储库。

git clone user1@ip:/path/project.git (over ssh)
password: <enter user1 password>

一切都放在一个文件夹项目中。 该用户现在可以添加,推入,拉入等。

然后,我们尝试第二个用户

git clone user2@ip:/path/project.git (over ssh)
password: <enter user2 password>

我们得到这个

fatal: '/path/project.git' does not appear to be a git repository
fatal: Could not read from remote repository.

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

我们可以毫无问题地用SSH连接第二个用户,因此它不是一个错误的密码。 您知道我们为什么会遇到这个问题吗?

看起来您没有设置git deamon

阅读整个页面(简短内容),并按照步骤操作。 不要跳过定义可共享项目的部分。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM