# Tip: avoiding net overhead using git over sshfs

5 messages from 2008-10-23 to 2008-10-23. Participants: Felipe Carvalho Oliveira, Michael J Gruber, Matthieu Moy, Johannes Sixt.
Thread: https://gitlist.dev/t/16018

## Felipe Carvalho Oliveira, 2008-10-23 01:26

Subject: Tip: avoiding net overhead using git over sshfs
Message-ID: <a2075f4c0810221826w511a3b87r6fea4fb0dee24e1f@mail.gmail.com>
URL: https://gitlist.dev/e/a2075f4c0810221826w511a3b87r6fea4fb0dee24e1f%40mail.gmail.com

```
Use git over sshfs is not so good, but is an option for people that
don't have shell acess to the server/hosting like me.

# mounting
sshfs -o workaround=rename <user>@<host>:/home/<user>/  <mount_point>
cd <the_directory_of_your_project>

# we will move the .git directory to the local filesystem
mv .git ~/.my_project_git
# and create a symlink to the local .git
ln -s ~/.my_project_git .git

Done!

Now you can open gitk instantly ;-) and don't need to have the entire
.git thing on a remote filesystem.

         Felipe (from Brazil, my english skills aren't so good :-)

```

## Michael J Gruber, 2008-10-23 08:32

Subject: Re: Tip: avoiding net overhead using git over sshfs
Message-ID: <490036A2.20608@drmicha.warpmail.net>
URL: https://gitlist.dev/e/490036A2.20608%40drmicha.warpmail.net
In-Reply-To: <a2075f4c0810221826w511a3b87r6fea4fb0dee24e1f@mail.gmail.com>

```
Felipe Carvalho Oliveira venit, vidit, dixit 23.10.2008 03:26:
> Use git over sshfs is not so good, but is an option for people that
> don't have shell acess to the server/hosting like me.

I'm sorry but I'm afraid I'm missing the point: If you don't have shell
access then you can't use ssh(fs), can you?
Maybe you mean you can't set up git daemon or gitweb.cgi on the server?

> # mounting
> sshfs -o workaround=rename <user>@<host>:/home/<user>/  <mount_point>
> cd <the_directory_of_your_project>
> 
> # we will move the .git directory to the local filesystem
> mv .git ~/.my_project_git
> # and create a symlink to the local .git
> ln -s ~/.my_project_git .git
> 
> Done!
> 
> Now you can open gitk instantly ;-) and don't need to have the entire
> .git thing on a remote filesystem.

In fact your complete git repository is now on the local filesystem,
with only the worktree checked out on sshfs. Is that what you are trying
to achieve? Or do you want to "synchronize" repos on local and sshfs
filesystems?

Michael

```

## Matthieu Moy, 2008-10-23 09:00

Subject: Re: Tip: avoiding net overhead using git over sshfs
Message-ID: <vpqprlru1na.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqprlru1na.fsf%40bauges.imag.fr
In-Reply-To: <a2075f4c0810221826w511a3b87r6fea4fb0dee24e1f@mail.gmail.com>

```
"Felipe Carvalho Oliveira" <felipekde@gmail.com> writes:

> Use git over sshfs is not so good, but is an option for people that
> don't have shell acess to the server/hosting like me.
>
> # mounting
> sshfs -o workaround=rename <user>@<host>:/home/<user>/  <mount_point>
> cd <the_directory_of_your_project>
>
> # we will move the .git directory to the local filesystem
> mv .git ~/.my_project_git
> # and create a symlink to the local .git
> ln -s ~/.my_project_git .git

I think you'd better work locally, and push to the sshfs directory
from time to time. Then, you'd both have working tree and .git locally
and fast, while keeping the safety of replicating to your ssh server.

-- 
Matthieu

```

## Felipe Carvalho Oliveira, 2008-10-23 11:51

Subject: Re: Tip: avoiding net overhead using git over sshfs
Message-ID: <a2075f4c0810230451lefff6ffnc283f4078eff9f9c@mail.gmail.com>
URL: https://gitlist.dev/e/a2075f4c0810230451lefff6ffnc283f4078eff9f9c%40mail.gmail.com
In-Reply-To: <490036A2.20608@drmicha.warpmail.net>

```
On Thu, Oct 23, 2008 at 6:32 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> I'm sorry but I'm afraid I'm missing the point: If you don't have shell
> access then you can't use ssh(fs), can you?
> Maybe you mean you can't set up git daemon or gitweb.cgi on the server?

Yes, i can't set up any git daemon or any other software.
I have just sftp acess. And sftp is a "dumb protocol" to use git.

On Thu, Oct 23, 2008 at 7:00 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> I think you'd better work locally, and push to the sshfs directory
> from time to time. Then, you'd both have working tree and .git locally
> and fast, while keeping the safety of replicating to your ssh server.

I can't use git-push as I explained before.
I use git as a deployment tool in this case.
I work locallly and use git-pull to sync my local repo and the
"production"(server).
Git works better than a manual (S)FTP sync.


I hope I'm more clear now.

--
Felipe

```

## Johannes Sixt, 2008-10-23 12:54

Subject: Re: Tip: avoiding net overhead using git over sshfs
Message-ID: <490073F8.6080509@viscovery.net>
URL: https://gitlist.dev/e/490073F8.6080509%40viscovery.net
In-Reply-To: <a2075f4c0810230451lefff6ffnc283f4078eff9f9c@mail.gmail.com>

```
Felipe Carvalho Oliveira schrieb:
> On Thu, Oct 23, 2008 at 7:00 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
>> I think you'd better work locally, and push to the sshfs directory
>> from time to time. Then, you'd both have working tree and .git locally
>> and fast, while keeping the safety of replicating to your ssh server.
> 
> I can't use git-push as I explained before.
> I use git as a deployment tool in this case.
> I work locallly and use git-pull to sync my local repo and the
> "production"(server).
> Git works better than a manual (S)FTP sync.

Then how about this: You keep your repository local, and you also hack
locally. When it's time to push your changes to the production server, you
do this:

  $ GIT_INDEX_FILE=.git/index.published \
    GIT_WORK_TREE=/sshfs-mount/on/production/server \
    git reset --hard

This will update only files that changed since you did this the last time.

Disclaimer: I didn't try this myself.

-- Hannes

```
