致命的:' ~peterI / public_html / public.git'似乎不是一个致命的git存储库:无法从远程存储库读取

时间:2018-05-31 18:51:14

标签: git

我有两个公共存储库:originpeterI

C:\Users\[path]\app>git remote -v
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (fetch)
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (push)
peterI  ssh://manuelM@example.net/~peterI/public_html/public.git (fetch)
peterI  ssh://manuelM@example.net/~peterI/public_html/public.git (push)

当我尝试从公共存储库peterI获取最新代码时,我收到此错误:

C:\Users\[path]\app>git fetch 
manuelM@example.net's password: [My password] 
fatal: '~peterI/public_html/public.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://manuelM@example.net/~peterI/public_html/public.git。我需要配置哪些访问权限?也许有关权限的事情?感谢。

更新1.我尝试了Trevor Tracy在他的回答中提出的建议并没有成功:

C:\Users\[path]\app>git remote -v
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (fetch)
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (push)
peterI  ssh://manuelM@example.net/~peterI/public_html/public.git (fetch)
peterI  ssh://manuelM@example.net/~peterI/public_html/public.git (push)

C:\Users\[path]\app>git remote remove peterI

C:\Users\[path]\app>git remote -v
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (fetch)
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (push)

C:\Users\[path]\app>git remote add peterI ssh://manuelM@example.net/~peterI/public_html/public.git

C:\Users\[path]\app>git remote -v
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (fetch)
origin  ssh://manuelM@example.net/~manuelM/public_html/public.git (push)
peterI  ssh://manuelM@example.net/~peterI/public_html/public.git (fetch)
peterI  ssh://manuelM@example.net/~peterI/public_html/public.git (push)

C:\Users\[path]\app>git fetch peterI
manuelM@example.net's password: [My password]
fatal: '~peterI/public_html/public.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.


C:\Users\[path]\app>

更新2.我去看文件.git \ config,这就是我在该文件末尾看到的内容:

[remote "peterI"]
url = ssh://manuelM@example.net/~peterI/public_html/public.git
fetch = +refs/heads/*:refs/remotes/peterI/*

公共存储库ssh://manuelM@example.net/~peterI/public_html/public.git似乎就在那里。我可能做错了什么?也许我需要ssh的具体权限://manuelM@example.net/~peterI/public_html/public.git?

更新3:我开始怀疑这是Linux中文件和文件夹权限的问题。

2 个答案:

答案 0 :(得分:1)

这是权限问题。我不得不创建一个组并添加用户。然后将Git文件夹的组所有权更改为我创建的该组,问题已修复。

我已经从一台服务器迁移到另一台服务器,并且出于某种原因,在迁移过程中,该组对于Git文件夹并不相同。现在一切正常,问题出在权限上。

答案 1 :(得分:0)

尝试git fetch peterI

您还可以删除旧遥控器:

$git remote remove peterI

添加丢失的遥控器:

$git remote add peterI ssh://manuelM@example.net/~peterI/public_html/public.git

$git fetch peterI master