大网数据广告活动
服务器运维问答

How to make sshfs + VPN + git a tolerable working environment?

· 52CE 我爱测

Currently the code base for the project I am working on is remotely on a company server. and it has to stay like that. also the remote git repository cannot be made public. My current setup is: Connect to the VPN run sshfs to mou…

问题原文

原帖链接 · Asgaroth · CC BY-SA 3.0

Currently the code base for the project I am working on is remotely on a company server. and it has to stay like that. also the remote git repository cannot be made public.

My current setup is:

  • Connect to the VPN
  • run sshfs to mount a copy of the code
  • start working on the code
  • when I am done: ssh to the remote server and run git commands there

The problem with this, is that the VPN falls from time to time, so My sshfs mounth breaks, and my IDE freezes. what I do is to manually reconnect the VPN, then run sshfs again, and get back to work.

But it gets annoying as the VPN falls more often.

So I wonder if there are any settings for sshfs for some sort of cache, that would allow me to work, and only sync the changes when the VPN gets back.

That may make no sense, since if the remote driver is not available there is nothing to write to. So what about a different setup that uses some watch kind of thing and uses rsync to move changes in a bidirectional way (either when I save a file, or when I do git pull )

I can't just git clone, because I can't reproduce the entire environment to work 'locally' (DB and stuff)

the code has to be in their servers, in order for me to test/see my work I have to access a URL, that is my sandbox. I can't git push each time I want to see my changes.

社区高分解答

原帖链接 · diamonddog · CC BY-SA 3.0

I am using this sshfs options to minimize latency:

sshfs -o Ciphers=arcfour,compression=no,nonempty,auto_cache,reconnect,workaround=all [email omitted]:/usr/local/gitdev/ ~/dev/code

It has the reconnect flag, all sshfs workarounds, using auto cache and arcfour chiper.

You can read about those options on sshfs manual, I found those the fastest sshfs options at least to my setup.

ETA: More on sshfs performance read here: sshfs performance

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-01-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。