# Merge pull request \#96 from entireio/feat/remote-helper-transport

`08dcc31`→[main](/content/gh/entireio/git-sync/commits/main/index.html)·

Soph·3w ago·6 files·+755 added/-0 removed

Support git remote-helper schemes (entire://) as a transport

## Changes

6

- MREADME.md+8
- docs

- Musage.md+29

- internal

- gitproto

- Ahelper.go+386

- Ahelper_test.go+269

- Mpktline.go+48

- syncer

- Msyncer.go+15

```
136 unmodified lines

```ssh://`, SCP-style `git@host:path.git`, and `git+ssh://` URLs. See
[docs/usage.md](docs/usage.md) for details and current caveats.

### What about other URL schemes (e.g. `entire://`)?

For any scheme it has no native transport for, `git-sync` falls back to a git
remote helper named `git-remote-<scheme>` on `PATH`, exactly as `git` does. With
`git-remote-entire` installed, `entire://` URLs work for both fetch and push and
authenticate through the helper. See
[Remote-helper schemes](docs/usage.md#remote-helper-schemes).

### Does it run as a daemon or watch for changes?

No. `git-sync` is a one-shot CLI/library operation. To sync on a schedule or in
response to events, run it from cron, CI, a worker, or another service.
```

### Sync Behavior

`sync` picks the bootstrap relay path automatically when the target is empty. For
non-empty targets, safe fast-forward updates also use a relay path that streams the
source pack directly into target `receive-pack` without local materialization.
Anything not relay-eligible (force, prune, deletes, tag retargets) falls back to a
materialized path bounded by `--materialized-max-objects`.

```go
package gitproto

import (
	"bufio"
	"bytes"
	"context"
	"errors"
	"fmt"
	"io"
	"net/url"
	"os"
	"os/exec"
	"slices"
	"strings"
	"sync"
)

// RemoteHelperLookPath resolves the git remote-helper binary for a URL scheme,
// following git's `git-remote-<scheme>` naming convention. Replaceable in
// tests; production wiring just calls exec.LookPath.
var RemoteHelperLookPath = func(scheme string) (string, bool) {
	path, err := exec.LookPath("git-remote-" + scheme)
	if err != nil {
		return "", false
	}
	return path, true
}

// LookupRemoteHelper reports whether a git remote helper is installed for the
// given URL scheme (e.g. "entire" → git-remote-entire). Schemes git-sync
// speaks natively (http/https/ssh) should never be routed here — git ships
// git-remote-http(s), and diverting to it would bypass the optimized native
// transport.
func LookupRemoteHelper(scheme string) (string, bool) {
	if scheme == "" {
		return "", false
	}
	return RemoteHelperLookPath(scheme)
}

// ... additional code and definitions follow ...

```
