gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 03:45:40 25 4
gpt4 key购买 nike

我们是两个正在开发一个项目的开发人员,我在服务器(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>

所有内容都放在一个文件夹项目中。该用户现在可以执行添加、推送、 pull 等操作。

然后我们尝试第二个用户

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

阅读整页(很短的一页)并按照步骤操作。不要跳过定义可以共享哪些项目的部分。

关于linux - git over ssh 第二个用户无法克隆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28312760/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com