git-clone-resume 0.1.2 → 0.1.4
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.en.md +69 -0
- package/README.md +2 -0
- package/git-clone-resume.ps1 +1685 -1421
- package/git-clone-resume.tui.ps1 +117 -18
- package/package.json +3 -2
package/README.en.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Git Clone Resume for Windows
|
|
2
|
+
|
|
3
|
+
Resume-friendly partial cloning for GitHub and other unstable networks. The tool fetches commit/tree metadata first, then checks out files in batches. Run the same command again after an interruption to resume.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Git for Windows >= 2.19
|
|
8
|
+
- Windows PowerShell 5.1 or PowerShell 7+
|
|
9
|
+
- Optional: `git config --global core.longpaths true`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
Install from npm:
|
|
14
|
+
|
|
15
|
+
```powershell
|
|
16
|
+
npm install -g git-clone-resume
|
|
17
|
+
gcr https://github.com/user/repo.git
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The package still requires Git for Windows and PowerShell. Release ZIP packages contain both `gcr` and `git-clone-resume` launchers.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Start the fullscreen wizard without a URL, or pass a URL directly:
|
|
25
|
+
|
|
26
|
+
```bat
|
|
27
|
+
git-clone-resume.cmd
|
|
28
|
+
git-clone-resume.cmd https://github.com/user/repo.git
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
PowerShell users can call the script directly:
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
.\git-clone-resume.ps1 https://github.com/user/repo.git -Ref main -OutDir D:\src\repo
|
|
35
|
+
.\git-clone-resume.ps1 https://github.com/user/repo.git -Include src/*,docs/* -Exclude *.bin
|
|
36
|
+
.\git-clone-resume.ps1 https://github.com/user/repo.git -BatchSize 64 -MaxRetries 12
|
|
37
|
+
.\git-clone-resume.ps1 https://github.com/user/repo.git -Verify
|
|
38
|
+
.\git-clone-resume.ps1 https://github.com/user/repo.git -DryRun
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use `-NoTui` in CI or when output is redirected. Use `-Tui` to force the fullscreen interface.
|
|
42
|
+
|
|
43
|
+
## Language
|
|
44
|
+
|
|
45
|
+
On the first wizard screen, select `Language` and choose Chinese or English. Press `L` in the wizard or progress panel to switch at any time. The command-line equivalent is:
|
|
46
|
+
|
|
47
|
+
```powershell
|
|
48
|
+
.\git-clone-resume.ps1 https://github.com/user/repo.git -Language en-US
|
|
49
|
+
.\git-clone-resume.ps1 https://github.com/user/repo.git -Language zh-CN
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Resume State
|
|
53
|
+
|
|
54
|
+
Progress is stored outside the worktree in `.git/partial-resume/`. Do not delete the target repository's `.git` directory. Completed files are skipped on subsequent runs; failed files are retried.
|
|
55
|
+
|
|
56
|
+
The tool skips submodule gitlinks. Run it separately for submodules. After checking out Git LFS files, run `git lfs pull` if actual LFS content is needed.
|
|
57
|
+
|
|
58
|
+
## TUI Keys
|
|
59
|
+
|
|
60
|
+
- `Q` / `Ctrl+C`: stop after the current Git command; press again to force stop
|
|
61
|
+
- `P` / `Esc`: pause after the current batch
|
|
62
|
+
- `Space`: resume from pause
|
|
63
|
+
- `F`: show failed files
|
|
64
|
+
- `L`: switch language
|
|
65
|
+
- `Up` / `Down` / `j` / `k`: scroll activity
|
|
66
|
+
- `?` / `H`: show help
|
|
67
|
+
- `Enter`: close the result screen
|
|
68
|
+
|
|
69
|
+
See the Chinese guide in [README.md](README.md) for the full implementation details and release channels.
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Git 断点续传克隆(Windows)
|
|
2
2
|
|
|
3
|
+
English documentation: [README.en.md](README.en.md). 启动向导时可选择语言,也可使用 `-Language en-US`;向导和克隆面板中按 `L` 可随时切换。
|
|
4
|
+
|
|
3
5
|
针对 GitHub 等网络不稳定场景:先用 **partial clone** 只拉 commit/tree 元数据,再 **按批 checkout 文件**。中断后用同一条命令再跑即可续传。
|
|
4
6
|
|
|
5
7
|
对应 Linux 参考脚本:<https://github.com/chaihahaha/git-cheatsheet> 中的 `clone_1by1.sh`。
|