Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push over sshfs failing with "error when closing sha1 file: Bad file descriptor"

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?

like image 404
John Kary Avatar asked Oct 27 '25 03:10

John Kary


1 Answers

Git can push over SSH natively without having to mount the server to the local filesystem. I would recommend trying this:

git push [email protected]:/path/to/directory master

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.

like image 171
jonescb Avatar answered Oct 28 '25 17:10

jonescb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!