clonetree_windows-arm64 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -24
- package/clonetree-windows-arm64.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="docs/assets/clonetree.svg" alt="Clonetree:
|
|
2
|
+
<img src="docs/assets/clonetree.svg" alt="Clonetree logo: two outlined pines, sage and orange, overlapping in solid brown" width="128" height="128">
|
|
3
3
|
<h1>clonetree</h1>
|
|
4
|
-
<p><strong>
|
|
4
|
+
<p><strong>Copy your repo, node_modules and all, in seconds.<br>Only changes take up disk space.</strong></p>
|
|
5
5
|
<p>Keep local edits, installed dependencies, and build output.</p>
|
|
6
6
|
<p>
|
|
7
7
|
<a href="#quick-start"><strong>Quick start</strong></a> ·
|
|
@@ -30,6 +30,11 @@ starting from the files on disk rather than a commit.
|
|
|
30
30
|
In our [APFS benchmark](#benchmark), a **57.1 GiB checkout** with **320,652 files**
|
|
31
31
|
cloned in **9.9 seconds** on average.
|
|
32
32
|
|
|
33
|
+
<picture>
|
|
34
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/demo-dark.gif">
|
|
35
|
+
<img src="docs/assets/demo.gif" alt="Terminal recording: clonetree shows its overview beside the logo, clonetree new my-feature clones a 2.9 GiB project in about four seconds, clonetree ls lists five snapshots instantly, and clonetree info measures them with a live progress bar per snapshot." width="800">
|
|
36
|
+
</picture>
|
|
37
|
+
|
|
33
38
|
**Requires macOS with APFS, or Linux with reflink-enabled XFS/Btrfs.** Source and
|
|
34
39
|
destination must be on the same filesystem. No Git repository is required.
|
|
35
40
|
|
|
@@ -42,7 +47,7 @@ brew install sprisa/tap/clonetree
|
|
|
42
47
|
# npm
|
|
43
48
|
npx clonetree
|
|
44
49
|
|
|
45
|
-
# Go 1.
|
|
50
|
+
# Go 1.26+
|
|
46
51
|
go run github.com/sprisa/clonetree@latest
|
|
47
52
|
```
|
|
48
53
|
|
|
@@ -64,10 +69,11 @@ cd clonetree/my-feature.clonetree
|
|
|
64
69
|
repository or a snapshot; `new` does the cloning. Directories ending in
|
|
65
70
|
`.clonetree` are skipped, so new snapshots don't contain your older ones.
|
|
66
71
|
|
|
67
|
-
Back in the original directory,
|
|
72
|
+
Back in the original directory, list, measure, or remove your workspaces:
|
|
68
73
|
|
|
69
74
|
```sh
|
|
70
|
-
clonetree
|
|
75
|
+
clonetree ls # Instant: IDs and paths
|
|
76
|
+
clonetree info # Measures sizes, with live progress per snapshot
|
|
71
77
|
clonetree delete my-feature # Removes the workspace, including its local changes
|
|
72
78
|
```
|
|
73
79
|
|
|
@@ -78,7 +84,7 @@ The equivalent commands:
|
|
|
78
84
|
| What you want to do | Git worktree | clonetree |
|
|
79
85
|
| --- | --- | --- |
|
|
80
86
|
| Create a workspace | `git worktree add ../my-feature -b my-feature` | `clonetree new my-feature` |
|
|
81
|
-
| List workspaces | `git worktree list` | `clonetree
|
|
87
|
+
| List workspaces | `git worktree list` | `clonetree ls` |
|
|
82
88
|
| Remove a workspace | `git worktree remove ../my-feature` | `clonetree delete my-feature` |
|
|
83
89
|
|
|
84
90
|
The important difference is **what you start with**:
|
|
@@ -112,11 +118,11 @@ read the [repository metadata details](#repository-metadata) below.
|
|
|
112
118
|
### Choose a snapshot directory
|
|
113
119
|
|
|
114
120
|
The source is always your current directory. `--dir` (or `-d`) changes the parent
|
|
115
|
-
directory used by `new`, `info`, and `delete`:
|
|
121
|
+
directory used by `new`, `ls`, `info`, and `delete`:
|
|
116
122
|
|
|
117
123
|
```sh
|
|
118
124
|
clonetree --dir ../workspaces new experiment
|
|
119
|
-
clonetree --dir ../workspaces
|
|
125
|
+
clonetree --dir ../workspaces ls
|
|
120
126
|
clonetree --dir ../workspaces delete experiment
|
|
121
127
|
```
|
|
122
128
|
|
|
@@ -124,31 +130,74 @@ This creates `../workspaces/experiment.clonetree/`. Relative paths are resolved
|
|
|
124
130
|
from the current directory; use the same parent when listing or deleting. Use
|
|
125
131
|
`--dir .` to create snapshots directly here instead of inside `./clonetree/`.
|
|
126
132
|
|
|
127
|
-
|
|
133
|
+
`ls`, `info`, and `delete` also accept the project folder: if `--dir` holds no
|
|
134
|
+
snapshots itself, they use its `clonetree/` folder, just as running them from
|
|
135
|
+
the project does. These are equivalent:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
clonetree --dir ~/code/my-app info
|
|
139
|
+
clonetree --dir ~/code/my-app/clonetree info
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`new` always creates directly in the folder you name.
|
|
143
|
+
|
|
144
|
+
### List and measure snapshots
|
|
128
145
|
|
|
129
|
-
`
|
|
130
|
-
|
|
146
|
+
`ls` (or `list`) prints snapshot IDs and paths immediately. It reads only the
|
|
147
|
+
snapshot directory, not the snapshots themselves:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
clonetree ls
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`info` measures how much disk each clone uses, and how much cloning saved
|
|
154
|
+
compared with an ordinary copy:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
ID DISK USED SAVED FULL COPY
|
|
158
|
+
hotfix-login 22.9 MiB 99.2% 2.9 GiB
|
|
159
|
+
main 9.1 MiB 99.6% 2.9 GiB
|
|
160
|
+
my-feature 0 B 100% 2.9 GiB
|
|
161
|
+
perf-experiment 171.7 MiB 94.5% 3.1 GiB
|
|
162
|
+
release-2-4 0 B 100% 2.9 GiB
|
|
163
|
+
|
|
164
|
+
5 snapshots · 203.6 MiB disk used · 14.6 GiB saved (98.6%) · measured in 2.0s
|
|
165
|
+
```
|
|
131
166
|
|
|
132
167
|
| Column | Meaning |
|
|
133
168
|
| --- | --- |
|
|
134
|
-
| `
|
|
135
|
-
| `
|
|
169
|
+
| `DISK USED` | Space only this clone takes, shared with no other clone, the original, or a filesystem snapshot. Deleting the clone frees roughly this much. |
|
|
170
|
+
| `SAVED` | The share of `FULL COPY` the clone doesn't use. |
|
|
171
|
+
| `FULL COPY` | The clone's logical file size: what an ordinary copy would take. |
|
|
172
|
+
|
|
173
|
+
`DISK USED` comes from APFS, which calls it private size. It doesn't include
|
|
174
|
+
each clone's own file metadata (inodes and directory entries), so a fresh clone
|
|
175
|
+
can show `0 B` while `new` reports tens of MiB added on disk. On Linux, XFS and
|
|
176
|
+
Btrfs don't report it, and the column shows `n/a`.
|
|
177
|
+
|
|
178
|
+
Snapshots are measured concurrently. In a terminal, each row resolves as soon as
|
|
179
|
+
its snapshot is measured, while the rest show a progress bar, size so far, and
|
|
180
|
+
elapsed time. Percentages are estimated from the entry counts of your previous
|
|
181
|
+
interactive `info` run (kept in the user cache directory); a snapshot without a
|
|
182
|
+
previous count shows a live entry count instead.
|
|
136
183
|
|
|
137
|
-
Measuring `
|
|
138
|
-
|
|
184
|
+
Measuring `DISK USED` asks APFS about every file. When you only need logical
|
|
185
|
+
sizes, skip that work to use less CPU:
|
|
139
186
|
|
|
140
187
|
```sh
|
|
141
|
-
clonetree info --
|
|
188
|
+
clonetree info --size-only
|
|
142
189
|
```
|
|
143
190
|
|
|
144
|
-
This shows `ID` and `SIZE
|
|
145
|
-
|
|
191
|
+
This shows `ID` and `SIZE` (logical size). It still walks the files.
|
|
192
|
+
|
|
193
|
+
`new` reports clone time and estimated additional disk usage.
|
|
146
194
|
|
|
147
195
|
### Control progress output
|
|
148
196
|
|
|
149
|
-
Interactive runs show the current phase and
|
|
150
|
-
directory being cloned and advance checked-entry progress during metadata
|
|
151
|
-
validation. Per-file rates and ETAs are omitted for native batches.
|
|
197
|
+
Interactive runs show the current phase and a running timer. APFS clones identify
|
|
198
|
+
the directory being cloned and advance checked-entry progress during metadata
|
|
199
|
+
validation. Per-file rates and ETAs are omitted for native batches. Terminals that
|
|
200
|
+
support it (OSC 9;4) also show progress in the tab or dock.
|
|
152
201
|
|
|
153
202
|
For plain output:
|
|
154
203
|
|
|
@@ -156,7 +205,23 @@ For plain output:
|
|
|
156
205
|
clonetree --no-progress new experiment
|
|
157
206
|
```
|
|
158
207
|
|
|
159
|
-
Non-interactive runs disable progress automatically
|
|
208
|
+
Non-interactive runs disable progress and colors automatically; `NO_COLOR` is
|
|
209
|
+
respected too. Progress is written to stderr, results to stdout.
|
|
210
|
+
|
|
211
|
+
### Shell completions
|
|
212
|
+
|
|
213
|
+
Tab-complete commands, options, and snapshot IDs (for `delete`, honoring
|
|
214
|
+
`--dir`). Homebrew installs completions for bash, zsh, and fish automatically.
|
|
215
|
+
Otherwise, add the line for your shell and open a new one:
|
|
216
|
+
|
|
217
|
+
```sh
|
|
218
|
+
echo 'source <(clonetree completion zsh)' >> ~/.zshrc
|
|
219
|
+
echo 'eval "$(clonetree completion bash)"' >> ~/.bashrc
|
|
220
|
+
clonetree completion fish > ~/.config/fish/completions/clonetree.fish
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Bash completion works with or without the bash-completion package, including
|
|
224
|
+
macOS's bash 3.2.
|
|
160
225
|
|
|
161
226
|
### Stop a running command
|
|
162
227
|
|
|
@@ -167,6 +232,9 @@ seconds to delete.
|
|
|
167
232
|
Press **Ctrl+C again** to exit without waiting for cleanup. If a partial clone
|
|
168
233
|
remains, remove it with `clonetree delete <id>` using the same `--dir` parent.
|
|
169
234
|
|
|
235
|
+
`delete` stops on Ctrl+C too. The snapshot is then partly deleted; run the same
|
|
236
|
+
`clonetree delete <id>` again to finish.
|
|
237
|
+
|
|
170
238
|
## Benchmark
|
|
171
239
|
|
|
172
240
|
A **57.1 GiB** directory containing **320,652 files**, **59,778 directories**, and
|
|
@@ -234,11 +302,11 @@ discover the original parent repository.
|
|
|
234
302
|
### Storage and consistency
|
|
235
303
|
|
|
236
304
|
- Files share storage until either workspace changes. Old data stays allocated
|
|
237
|
-
while any clone needs it; a clone's
|
|
305
|
+
while any clone needs it; a clone's disk usage can grow when the original
|
|
238
306
|
changes or is deleted.
|
|
239
307
|
- Added disk usage is estimated from filesystem free space. Other disk activity
|
|
240
308
|
and delayed accounting can affect it.
|
|
241
|
-
-
|
|
309
|
+
- `DISK USED` excludes shared blocks, file metadata, and filesystem-wide overhead.
|
|
242
310
|
Measurements are scanned live, and unavailable values appear as `n/a`.
|
|
243
311
|
- Cloning is not an atomic directory-wide snapshot. Stop writers and let VCS
|
|
244
312
|
operations finish before cloning if you need a consistent starting point.
|
|
@@ -248,8 +316,11 @@ discover the original parent repository.
|
|
|
248
316
|
| Looking for… | Start here |
|
|
249
317
|
| --- | --- |
|
|
250
318
|
| Commands and flags | `clonetree --help` or `clonetree <command> --help` |
|
|
319
|
+
| Re-recording the README demo and social preview | [`docs/demo/record.sh`](docs/demo/record.sh) |
|
|
251
320
|
| Runtime, memory use, and benchmark commands | [Performance](PERFORMANCE.md) |
|
|
252
321
|
| Native APFS tests and XFS/Btrfs tests in Ubuntu Docker or a VM | [Testing](TESTING.md) |
|
|
253
322
|
| Logo and social-preview artwork | [Brand assets](docs/BRANDING.md) |
|
|
254
323
|
|
|
255
324
|
Licensed under [MPL 2.0](LICENSE).
|
|
325
|
+
|
|
326
|
+
<img src="https://analytics.sprisa.com/p/Asts1wWV5" alt="" width="1" height="1">
|
|
Binary file
|
package/package.json
CHANGED