git push sshfs失败,并显示“关闭sha1文件时出错:错误的文件描述符"; [英] git push over sshfs failing with "error when closing sha1 file: Bad file descriptor"

查看:140
本文介绍了git push sshfs失败,并显示“关闭sha1文件时出错:错误的文件描述符";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用sshfs通过SSH挂载文件系统,并将其用作git存储库协作的远程存储.

We are mounting a filesystem over SSH using sshfs and are using it as a remote storage for git repository collaboration.

Mac OSX 10.6.6到RHEL 3服务器 SSHFS版本2.2(MacFUSE SSHFS 2.2.0)
MacFUSE库版本:FUSE 2.7.3/MacFUSE 2.0.3

Mac OSX 10.6.6 to a RHEL 3 server SSHFS version 2.2 (MacFUSE SSHFS 2.2.0)
MacFUSE library version: FUSE 2.7.3 / MacFUSE 2.0.3

sshfs -o workaround=rename gituser@gitserver.ourdomain.com:/path/to/directory ~/git

这是我们创建存储库的方法,在本地与它们一起使用,然后尝试将其推回服务器:

Here's how we're creating our repo's, working with them locally, then trying to push back to the server:

cd ~/git/mypersonaluser
git init --bare --share mynewrepo.git
git clone ~/git/mypersonaluser/mynewrepo.git ~/Desktop/mynewrepo
cd ~/Desktop/mynewrepo
... make a few edits to the repo ...
git push origin master

Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 20.82 KiB | 23 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
fatal: error when closing sha1 file: Bad file descriptor
error: unpack failed: unpack-objects abnormal exit
To /Users/joebob/git/mypersonaluser/mynewrepo.git/
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to '/Users/joebob/git/mypersonaluser/mynewrepo.git/'

奇怪的是,似乎对存储库推送的较小编辑成功完成,但是具有多个新文件或大量编辑的较大提交却不起作用.

What's weird is it appears that small edits to the repo push successfully, but that larger commits with multiple new files or large amounts of edits do not work.

我们是sshfs和MacFuse的新手,但是是git的中级用户.

We're sshfs and MacFuse newbies, but intermediate git users.

有什么想法或建议吗?

推荐答案

我们从未找到针对通过sshfs挂载服务器时遇到的问题的修复程序.但是我的一位同事确实弄清楚了如何在RHEL 3服务器上的单个帐户中本地安装git二进制文件,并且我们现在可以通过SSH与我们的远程存储库进行通信了,现在可以正常使用了.

We never found a fix to the issues we experienced when mounting the server over sshfs. But a co-worker of mine did figure out how to install the git binaries locally within a single account on the RHEL 3 server and we can now communicate with our remote repositories over SSH, which now works flawlessly.

这是他使用的安装命令,当通过SSH登录到服务器时应使用该安装命令:

Here are the install commands he used, which should be used when logged in to your server via SSH:

curl -O http://kernel.org/pub/software/scm/git/git-1.7.4.1.tar.gz
tar xvfz git-1.7.4.1.tar.gz
cd git-1.7.4.1
./configure --prefix=$HOME CFLAGS='-I/usr/kerberos/include'
make SHELL="/bin/bash" install

接下来,通过在服务器上编辑~/.bashrc并将此行添加到末尾,将远程帐户的bin目录添加到服务器帐户的PATH中:

Next, add your remote account's bin directory to the server account's PATH by editing ~/.bashrc on the server and adding this line to the end:

export PATH=$PATH:$HOME/bin

然后,您可以在开发计算机上定义一个远程存储库位置并将其推送到该位置.

From your development machine, you can then define a remote repository location and push to it.

git add remote myremote ssh://myuser@server.domain.com/home/myuser/path/to/repo.git
git push myremote branchnamehere

这篇关于git push sshfs失败,并显示“关闭sha1文件时出错:错误的文件描述符";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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