我们使用SSHF在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

这是我们如何创建回购,与当地合作,然后尝试返回服务器的方式:

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 Newbies,但是中间GIT用户。

有什么想法或建议吗?

有帮助吗?

解决方案 2

我们从未找到解决服务器上通过SSHFS安装的问题的解决方案。但是我的同事确实弄清楚了如何在RHEL 3服务器上的单个帐户中安装GIT二进制文件,现在我们可以通过SSH与远程存储库进行通信,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

其他提示

Git可以在本地推动SSH,而无需将服务器安装到本地文件系统。我建议尝试一下:

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

我这起作用,只需将您的原始遥控器更改为 gituser@gitserver.ourdomain.com:/path/to/directory 代替 ~/git

如果它不起作用,它至少会告诉我们MacFuse或SSHFS不应责备。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top