4

我们正在使用 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 gituser@gitserver.ourdomain.com:/path/to/directory ~/git

以下是我们如何创建我们的 repo,在本地使用它们,然后尝试推送回服务器:

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/'

奇怪的是,对 repo 的小编辑似乎成功推送,但是带有多个新文件或大量编辑的较大提交不起作用。

我们是 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 回答