git Push over sshfs 失败,并显示“关闭 sha1 文件时出错:错误的文件描述符”
我们使用 sshfs 通过 SSH 安装文件系统,并将其用作 git 存储库协作的远程存储。
Mac OSX 10.6.6 到 RHEL 3 服务器 SSHFS 版本 2.2(MacFUSE SSHFS 2.2.0)
MacFUSE 库版本:FUSE 2.7.3 / MacFUSE 2.0.3
sshfs -o workaround=rename [email protected]:/path/to/directory ~/git
下面是我们如何创建我们的存储库,在本地使用它们,然后尝试推送回服务器:
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/'
奇怪的是看来对存储库的小编辑成功推送,但包含多个新文件或大量编辑的较大提交不起作用。
我们是 sshfs 和 MacFuse 新手,但也是中级 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 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 [email protected]:/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.
We're sshfs and MacFuse newbies, but intermediate git users.
Any ideas or suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Git 可以本地通过 SSH 进行推送,而无需将服务器安装到本地文件系统。
我建议尝试这个:
我这有效,只需将您的原始远程更改为
[email&n公共服务提供商;protected]:/path/to/directory
而不是~/git
如果它不起作用,它至少会告诉我们 MacFuse 或 sshfs 不可用归咎于。
Git can push over SSH natively without having to mount the server to the local filesystem.
I would recommend trying this:
I this works, just change your origin remote to
[email protected]:/path/to/directory
instead of~/git
If it doesn't work either it will at least tell us that MacFuse or sshfs isn't to blame.
我们从未找到解决通过 sshfs 安装服务器时遇到的问题的方法。但我的一位同事确实弄清楚了如何在 RHEL 3 服务器上的单个帐户中本地安装 git 二进制文件,我们现在可以通过 SSH 与远程存储库进行通信,现在可以完美运行。
以下是他使用的安装命令,通过 SSH 登录到服务器时应使用这些命令:
接下来,通过编辑将远程帐户的
bin
目录添加到服务器帐户的PATH
中在服务器上的~/.bashrc
并将此行添加到末尾:然后,您可以从您的开发计算机定义远程存储库位置并将其推送到该位置。
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.
Here are the install commands he used, which should be used when logged in to your server via SSH:
Next, add your remote account's
bin
directory to the server account'sPATH
by editing~/.bashrc
on the server and adding this line to the end:From your development machine, you can then define a remote repository location and push to it.