Git 远程似乎不是 git 存储库

Git remote does not appear to be a git repository

我正在开发一个 craft cms 应用程序。该仓库有 3 个遥控器:

以前所有的遥控器都能用,但后来无缘无故中断了。

错误如下所示:

fatal: '/srv/users/******/apps/****/repo' 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.

这是配置文件在服务器上的样子

[core]
    repositoryformatversion = 0
    filemode = true
    bare = true
[remote "origin"]
    url = git@bitbucket.org:****/****.git
    fetch = +refs/*:refs/*
    mirror = true

考虑到它曾经有效,不知道还有什么要检查的:-(

upd.

原来 object 文件夹滑入了另一个文件夹(感谢我的老板),只需将其移回即可解决问题![​​=15=]

这取决于产生错误的命令。

git ls-remote production 应该可以。
但是您当前的本地配置没有显示任何远程“production”来源,因此您可能需要将其添加回来。

我问 OP Mikhai Cheburakhtin,在交互式远程 shell 会话中,他是否可以访问 /srv/users/serverpilot/apps/****/repo,并在其中执行 git log

Yes I can, but it throws an error: fatal: Not a git repository (or any of the parent directories): .git

这将解释错误消息。

OP 添加:

I started comparing repo folders and there is objects folder that was missing and I find it inside another folder: so just moving this folder back to it's place solved the problem!

这是我的本地配置文件的样子:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "staging"]
    url = ssh://serverpilot@********.com/~/apps/****-staging/repo
    fetch = +refs/heads/*:refs/remotes/staging/*
[remote "origin"]
    url = https://********@bitbucket.org/******/****.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "production"]
    url = serverpilot@****.com:/srv/users/serverpilot/apps/****/repo
    fetch = +refs/heads/*:refs/remotes/production/*

另一个问题是服务器上的配置文件是否应该有除 origin 之外的任何远程?

此外,服务器上的生产文件夹和暂存文件夹都有 repo 文件夹,暂存文件夹中的配置文件没有任何遥控器并且可以工作:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = true