Merge pull request #21 from entireio/docs/readme-installation-instructions · Entire

Merge pull request #21 from entireio/docs/readme-installation-instructions

b2ab44b→main·

georg·2mo ago·1 file·+28 added/-8

Add installation instructions to README

Changes

1

30 unmodified lines

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
37
57
58
59
60
5 unmodified lines

66
67
68
49
69
70
71
72
4 unmodified lines

77
78
79
60
80
81
82
83
4 unmodified lines

88
89
90
71
91
92
93
94
7 unmodified lines

102
103
104
85
105
106
107
108
4 unmodified lines

113
114
115
96
116
117
118
119
2 unmodified lines

122
123
124
105
125
126
127
128
3 unmodified lines

132
133
134
115
135
136
137
138

30 unmodified lines

`git-sync` is also a Go library. Use `entire.io/entire/gitsync` for the stable embedding surface (`Probe`, `Plan`, `Sync`, `Replicate`, typed results, auth and HTTP injection). `entire.io/entire/gitsync/unstable` exposes advanced controls (`Bootstrap`, `Fetch`, batching knobs, heap measurement) and is not stable.

## Installation

Requires Go 1.26 or newer.

Install the latest release with `go install`:

```bash
go install entire.io/entire/gitsync/cmd/git-sync@latest
```

This drops a `git-sync` binary into `$(go env GOPATH)/bin`. Make sure that directory is on your `PATH`.

Or build from source:

```bash
git clone https://github.com/entireio/gitsync.git
cd gitsync ngo build -o git-sync ./cmd/git-sync
```

## Quick Start

```bash
go run ./cmd/git-sync sync \ngit-sync sync \n  --source-token "$GITSYNC_SOURCE_TOKEN" \n  --target-token "$GITSYNC_TARGET_TOKEN" \nhttps://github.com/source-org/source-repo.git \n5 unmodified lines

Run a replication that overwrites differing target refs, and fail instead of falling back to local materialization:

```bash
go run ./cmd/git-sync replicate \ngit-sync replicate \n  --stats \n  https://github.com/source-org/source-repo.git \n  https://github.com/target-org/target-repo.git
4 unmodified lines

For very large initial migrations, add `--target-max-pack-bytes` to split the initial pack into multiple smaller batches. The same flag works on `sync`, since `sync` auto-bootstraps on empty targets:

```bash
go run ./cmd/git-sync sync \ngit-sync sync \n  --target-max-pack-bytes 536870912 \n  --protocol v2 \n  -v \n4 unmodified lines

Add `--measure-memory` to any command to sample elapsed time and Go heap usage:

```bash
go run ./cmd/git-sync sync \ngit-sync sync \n  --measure-memory \n  --json \n  <source-url> \n7 unmodified lines

Sync specific branches:

```bash
go run ./cmd/git-sync sync \ngit-sync sync \n  --branch main,release \n  --source-token "$GITSYNC_SOURCE_TOKEN" \n  --target-token "$GITSYNC_TARGET_TOKEN" \n4 unmodified lines

Map a source branch to a different target branch:

```bash
go run ./cmd/git-sync sync \ngit-sync sync \n  --map main:stable \n  <source-url> \n  <target-url>
2 unmodified lines

Mirror tags and prune managed target refs that disappeared from source:

```bash
go run ./cmd/git-sync sync \ngit-sync sync \n  --tags \n  --prune \n<source-url> \n3 unmodified lines

Force source-side protocol v2:

```bash
go run ./cmd/git-sync sync \ngit-sync sync \n  --protocol v2 \n  <source-url> \n  <target-url>