简体   繁体   English

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

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

We are two developers working on a project and I set a git repository on a server (ArchLinux) we both have access over ssh. 我们是两个开发人员在一个项目上工作,我在服务器(ArchLinux)上设置了一个git仓库,我们两个人都可以通过ssh进行访问。 The git repository was created the following way : 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

our group name is dev and both users are in the group (checked in /etc/groups) 我们的组名为dev,两个用户都在该组中(在/ etc / groups中选中)

On a second machine (can be mine or the second developer's), we clone the repository this way. 在第二台机器上(可以是我的机器,也可以是第二个开发者的机器),我们以这种方式克隆存储库。

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

Everything is put inside a folder project. 一切都放在一个文件夹项目中。 This user can now do add, push, pull etc. 该用户现在可以添加,推入,拉入等。

Then we try the second user 然后,我们尝试第二个用户

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

and we get this 我们得到这个

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.

We can connect the second user with SSH with no problem so it's not a bad password. 我们可以毫无问题地用SSH连接第二个用户,因此它不是一个错误的密码。 Do you have any idea why we encounter this problem? 您知道我们为什么会遇到这个问题吗?

Looks like you did not set up git deamon 看起来您没有设置git deamon

Read the whole page (its a short one) and follow the steps. 阅读整个页面(简短内容),并按照步骤操作。 Don't skip the part where you define which projects can be shared. 不要跳过定义可共享项目的部分。

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

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