Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git:推送到远程服务器失败,';存储库路径';不是git命令_Git_Ssh - Fatal编程技术网

Git:推送到远程服务器失败,';存储库路径';不是git命令

Git:推送到远程服务器失败,';存储库路径';不是git命令,git,ssh,Git,Ssh,我在Windows XP上使用Git和TortoiseGit, 我在WindowsVista 64位版本上有一个远程裸机存储库 当我试图将本地文件推送到远程裸机存储库时,收到以下错误消息 git.exe push "origin" master:master git: '/Git_Repository/.git' is not a git command. See 'git --help'. fatal: The remote end hung up unexpectedly 任意U

我在Windows XP上使用Git和TortoiseGit, 我在WindowsVista 64位版本上有一个远程裸机存储库

当我试图将本地文件推送到远程裸机存储库时,收到以下错误消息

git.exe push    "origin" master:master

git: '/Git_Repository/.git' is not a git command. See 'git --help'.

fatal: The remote end hung up unexpectedly
任意URL为:username@serverip:/Git\u Repository/.Git

在执行克隆/获取/拉取时,相同的任意URL工作正常

从远程机器中的本地目录访问这个裸存储库也没有问题,所以我相信我的路径有问题

我可以在GitHub上正确地推/拉,但我使用的是GitHub提供的URL

有人知道我的配置有什么问题吗

这是我的remote.git/config

[core]
repositoryformatversion = 0
filemode = false
bare = true
logallrefupdates = true
ignorecase = true
hideDotFiles = dotGitOnly
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads
url = username@serverip:/Git_Repository/.git
[branch "master"]
remote = origin
merge = refs/heads/master
这是我的local.git/config

[core]
repositoryformatversion = 0
filemode = false
bare = true
logallrefupdates = true
ignorecase = true
hideDotFiles = dotGitOnly
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads
url = username@serverip:/Git_Repository/.git
[branch "master"]
remote = origin
merge = refs/heads/master
我编辑了URL以使其更精确,但它仍然显示相同的错误

更重要的是,无论我在serverip之后键入什么,它仍然显示相同的错误消息

如果URL是

ssh://user@服务器ip/Git\u repositoryErrorName/.Git

然后返回错误消息

git:'/git\u repositoryErrorName/.git'不是git命令。请参阅“git--help”

当用户连接到远程存储库时,执行的git命令来自SSH中的bin目录。所以我相信我的SSH配置有问题,这就是为什么我可以在远程机器的本地/本地中正常执行git操作的原因

我按照指南中的说明链接了4个命令

我错过什么了吗


感谢您的阅读

尝试显式指定协议(此处为ssh),避免在user@host部分和本地路径(查看中描述的URL):

换句话说,避免使用这种路径。

如何

git push file:///\\<machine-ip>/<share-remote-repo>/
git推送文件:///\\//
已解决

在本地运行此命令:

git config --global remote.origin.receivepack "git receive-pack"
然后在本地回购协议中运行

git push origin master
或者,您可以将receiveoack命令附加到每次推送

git push --receive-pack='git receive-pack'

show.git/config——我想,这里有一些非常奇怪的东西。drop.git来自URL我正在使用cygwin到linux,并且有同样的问题。我将远程回购创建为共享,并能够在本地克隆它。但是现在我不能把它推回到中央服务器即使是从repo内部进行的基本“git推送”也会取消完整的“git:'/path/to/remote/repo.git/”不是git命令。请参阅git--help。”我尝试了ssh url。但结果是一样的。git:'/git_Repository/.git'不是git命令。请参阅“git--help”。SSHURL的正确用法应该是ssh://username@如果目录位于C:/fatal:'///Git\u Repository/.Git'下,则serverip/Git\u Repository/.Git似乎不是Git存储库。它不起作用了…:(我认为此url用于本地目录,但仍然感谢您需要共享远程repo,并尝试不在路径末尾添加.git。我尝试从路径末尾删除.git,但不起作用