English 中文(简体)
尝试设置远程 git, 推动初始承诺给予“ gitt- receive- pack: not find” 。
原标题:Trying to set up remote git, pushing initial commit gives "git-receive-pack: not found"
  • 时间:2012-05-28 14:11:43
  •  标签:
  • git
  • push
  • nas

I m trying to set up a git origin on my Synology DS212J NAS server. When I try this command to push to the server:

git remote add nas ssh://username@nasip/volume1/path/to/repo/repo.git
git push nas master

I am first prompted with my password, which I enter. Then I am given the following error:

sh: git-receive-pack: not found
fatal: The remote end hung up unexpectedly

有谁知道这意味着什么 或我怎样才能修好它吗?

EDIT: This is what I m following, but I m getting the error when I try to push to the remote. http://rubypane.blogspot.com/2012/03/creating-new-git-repository-on-synology.html

问题回答

正如上文所解释的 che 和其他人对此有问题。 通常, 您的. profile and/ etc/ profile 通常在通过 ssh 进行记录时会被剖析, 但在本案中不会如此。 虽然这可以按照 wonko在< a href=" http://www.wonko.de/2010/04/ set- up- git- on- synlogy- nas.html" rel=“ nofol” >http://www.wonko.de/2010/04/set- up- git- on- synlogy- nas.html (第6步) 中解释的调整。 我提议的替代方案只是创建符号链接。 做以下操作:

cd /opt/bin
for gitfile in git* ; do ln -s /opt/bin/$gitfile /bin/$gitfile ; done

记住在发布这些命令之前以 root 登录。

看起来您没有在远程框上安装 Git 。 Git 使用它自己在 ssh 上的协议, 所以您需要二进制来理解另一侧的 Git 对象 。

您客户端正在尝试运行的程序是 git- receive-pack , 所以尝试从您框中的 shell 运行。 如果这样可行, 您可以看到类似的东西 。

che@nok ~ $ git receive-pack
usage: git receive-pack <git-dir>

如果它不这样做:

-bash-4.0# git-receive-pack
-bash: git-receive-pack: command not found

如果您在那里安装了 git, 您应该尝试 git reception- pack 是否在那里工作。 如果它在那里工作, 您可能只需要在路径中某处将 git- receive- pack 连接到 git- receive- pack 。

运行中

cd `which git`
ln -si git git-receive-pack

根下可能为你做它。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...