4

sshfsを使用してSSH経由でファイルシステムをマウントし、gitリポジトリコラボレーションのリモートストレージとして使用しています。

Mac OSX10.6.6からRHEL3サーバーSSHFSバージョン2.2(MacFUSE SSHFS 2.2.0)
MacFUSEライブラリバージョン:FUSE 2.7.3 / MacFUSE 2.0.3

sshfs -o workaround=rename gituser@gitserver.ourdomain.com:/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ユーザーです。

何かアイデアや提案はありますか?

4

2 に答える 2

4

Gitは、サーバーをローカルファイルシステムにマウントしなくても、SSHをネイティブにプッシュできます。私はこれを試すことをお勧めします:

git push gituser@gitserver.ourdomain.com:/path/to/directory master

私はこれが機能します、あなたの原点をリモートgituser@gitserver.ourdomain.com:/path/to/directoryの代わりに変更するだけです~/git

それが機能しない場合でも、少なくともMacFuseまたはsshfsが原因ではないことがわかります。

于 2011-01-27T17:52:55.800 に答える
0

サーバーをsshfsにマウントするときに発生した問題の修正は見つかりませんでした。しかし、私の同僚は、RHEL 3サーバー上の単一のアカウント内にローカルでgitバイナリをインストールする方法を理解しました。これで、SSHを介してリモートリポジトリと通信できるようになりました。これにより、問題なく動作するようになりました。

彼が使用したインストールコマンドは次のとおりです。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

次に、サーバーで編集し、次の行を最後に追加して、リモートアカウントのbinディレクトリをサーバーアカウントのディレクトリに追加します。PATH~/.bashrc

export PATH=$PATH:$HOME/bin

次に、開発マシンから、リモートリポジトリの場所を定義してプッシュできます。

git add remote myremote ssh://myuser@server.domain.com/home/myuser/path/to/repo.git
git push myremote branchnamehere
于 2011-03-14T20:05:38.917 に答える