Git重复 - 找不到接收包 [英] Git duplication - receive pack not found

查看:143
本文介绍了Git重复 - 找不到接收包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我对git比较陌生。我有一个Rails应用程序作为新应用程序的基础(我怀疑这个问题来自哪里)。在初始应用程序中,我没有使用git的问题。对于新的应用程序,我初始化了一个回购,所有本地提交都很顺利,回购存储在github上,但是当我尝试推送时出现错误:


未找到git-receive-pack:你在服务器上运行git update-server-info?


到目前为止,我已经检查过git-receive-pack在/ usr / bin中,并且我也尝试了运行命令


user $ git push receive-pack = / usr / bin / git-receive-pack

我也尝试改变.git /配置文件按照这个问题( git-upload-pack:找不到命令,如何正确解决这个问题),以明确引用上传和接收包。
我也试过运行

lockquote
ssh user @ host echo \ $ PATH
/ blockquote>

检查远程非登录路径中的内容,但是我收到权限错误(permission denied:publickey)。

那么,还有其他建议吗?

更新:我通常不使用实际的git应用程序,但记得它在那里试图从它推而不是命令行。错误是不同的远程:找不到存储库。如果我在应用程序中搜索它,它会显示此存储库在磁盘上的位置已更改。更新2:根据以下timoras的问题,我想我现在已经(无意中 - 我只隐约知道我在做什么)从https切换到ssh。我尝试推送时遇到新错误:


$ git push -u原始主人

无效命令:'/ usr / bin / git-receive-pack'username / appname.git''

您似乎在使用ssh克隆一个git:// URL。



确保你的core.gitProxy配置选项和



GIT_PROXY_COMMAND环境变量未被设置。



致命:无法读取远程存储库



请确保您拥有正确的访问权限和存储库。


请注意,这是一个新错误,不是原始错误。



如果我运行'$ git config -e',输出如下:

  [core] 
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false

[remoteorigin]
url = git@github.com:username / appname.git
fetch = + refs / heads / *:refs / remotes / origin / *
uploadpack = / usr / bin / git-upload-pack
receivepack = / usr / bin / git-receive-pack
[remoteheroku]
url = git @ heroku.com:appname.git
fetch = + refs / heads / *:refs / remotes / heroku / *


<解决方案

好吧,对于那些在类似问题上苦苦挣扎的其他新手来说,这最终会成为一个传奇故事。我最终使用了各种各样的源代码,包括友好的github服务台人员了解以下内容(包括终端命令,对于像我这样的人来说,这些都是新鲜事物):


  1. Xcode开发者包会自动安装一个git版本。该版本安装在/ usr / bin中。您可以通过以下命令检查位置: $ which git

  2. 尝试更新时,我安装了自己的git版本,自动转到/ usr / local。两者之间存在版本冲突。由于位置不一致,git下载包中的uninstall.sh文件实际上并未卸载以前的版本。 删除Xcode开发包完全释放c。 7GB从我的驱动器,并没有造成任何问题。然而,它并没有解决根本问题,甚至没有删除旧版本的Git - 我最终不得不通过手动删除来删除这些文件。
  3. 删除旧的Git版本从/ usr / bin,我重新初始化回购( $ git init )。

  4. 然后我通过 $ git remote set-url origin https://github.com/username/repo-name.git
  5. 这允许我成功推送( $ git push -u origin master $ git push ),但是出现了奇怪的合并冲突,所以我从github( $ git pull origin master )退出,解决了与vimdiff一个话题本身 - 只是使用谷歌),然后再推。

显然都是固定的。 Github人员还建议创建一个新的克隆以用于将来的工作( $ git clone https://gitub.com/username/repo-name.git).



感谢大家的意见。


Ok, I'm relatively new to git etc. I have a Rails app I duplicated as the base for a new app (which I suspect is where this issue stems from). I had no issues with git on the initial app. For the new app I have initialized a repo, all the local commits are going fine, and the repo exists at github, but when I try to push I get an error:

git-receive-pack not found: did you run git update-server-info on the server?

So far I've checked that git-receive-pack is in /usr/bin, and a I also tried running the command

user$ git push receive-pack=/usr/bin/git-receive-pack

I also tried to alter the .git/config file as per this question ( git-upload-pack: command not found, how to fix this correctly ) to explicitly reference the upload and receive packs. I've also tried running

ssh user@host echo \$PATH

to check what's in the remote non-login path, but I get a permission error (permission denied: publickey).

So, any other suggestions?

UPDATE: I usually don't use the actual git app, but remembered it was there so tried to push from it instead of the command line. The error was different "remote: repository not found". If I search for it in the app it says "This repository's location on disk has changed". Where would it have gone?

UPDATE 2: As per timoras' question below, I think I've now (unintentionally - I only vaguely know what I'm doing) switched from https to ssh. I now get a NEW error when I try to push:

$ git push -u origin master

Invalid command: '/usr/bin/git-receive-pack 'username/appname.git''

You appear to be using ssh to clone a git:// URL.

Make sure your core.gitProxy config option and the

GIT_PROXY_COMMAND environment variable are NOT set.

fatal: Could not read from remote repository

Please make sure you have the correct access rights and the repository exists.

Note that this is a NEW error, NOT the original.

Below is the output if I run '$ git config -e':

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false

[remote "origin"]
url = git@github.com:username/appname.git
fetch = +refs/heads/*:refs/remotes/origin/*
uploadpack = /usr/bin/git-upload-pack
    receivepack = /usr/bin/git-receive-pack
[remote "heroku"]
url = git@heroku.com:appname.git
fetch = +refs/heads/*:refs/remotes/heroku/*

解决方案

Ok, so for other noobs out there struggling with similar issues, this ended up being quite a saga. I ended up using a variety of sources, including friendly github help desk people to figure out the following (Terminal commands are included for those that, like me, are new to all this):

  1. Xcode developer pack automatically installs a version of git. This version was installed in /usr/bin. You can check the location through the command: $ which git
  2. I had installed my own version of git when trying to update, which automatically goes to /usr/local. There was a version conflict between the two. Because of the disparity in location the uninstall.sh file from the git download pack did not actually uninstall previous versions.
  3. Removing Xcode developer pack completely freed up c. 7GB from my drive, and didn't cause any issues. It did not, however, solve the underlying problem and didn't even remove the old version of Git - I ended up having to remove those files through manual deletion.
  4. After removing the old Git version from /usr/bin, I reinitialized the repo ($ git init).
  5. I then re-set the git references through $ git remote set-url origin https://github.com/username/repo-name.git
  6. This allowed me to successfully push ($ git push -u origin master or $ git push), but there were strange merge conflicts, so I pulled from github ($ git pull origin master), resolved conflicts with vimdiff (a topic in itself - just use google) then pushed again.

Ta da! Apparently all fixed. The Github people also recommended creating a fresh clone to use in future work ($ git clone https://gitub.com/username/repo-name.git).

Thanks everyone for your input.

这篇关于Git重复 - 找不到接收包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆