git-sync-tui 0.1.0 → 0.1.3

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.
Files changed (4) hide show
  1. package/README.md +92 -34
  2. package/README.zh-CN.md +126 -0
  3. package/dist/cli.js +887 -196
  4. package/package.json +17 -3
package/README.md CHANGED
@@ -1,68 +1,126 @@
1
- # git-sync-tui
2
-
3
- Interactive TUI tool for cross-repo git commit synchronization.
4
-
5
- Cherry-pick commits from remote branches with an interactive terminal UI — select specific commits, preview changes, and sync with `--no-commit` mode for review before committing.
6
-
7
- ## Features
8
-
9
- - **Multi-select commits** — pick non-consecutive commits with Space/Enter
10
- - **`--no-commit` mode** — changes are staged, not committed, so you can review and edit before committing
11
- - **Diff preview** — see `--stat` summary of selected commits before executing
12
- - **Branch search** — filter branches by keyword
13
- - **Conflict handling** shows conflicted files when cherry-pick fails
14
- - **Language agnostic** — works in any git repo (Node.js, Go, Python, Java, etc.)
15
-
16
- ## Install
1
+ <h1 align="center">🔄 git-sync-tui</h1>
2
+
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/git-sync-tui"><img src="https://img.shields.io/npm/v/git-sync-tui.svg?color=0ea5e9" alt="npm version"></a>
5
+ <a href="https://www.npmjs.com/package/git-sync-tui"><img src="https://img.shields.io/npm/dm/git-sync-tui.svg?color=10b981" alt="downloads"></a>
6
+ <a href="https://github.com/KiWi233333/git-sync-tui/actions/workflows/publish.yml"><img src="https://github.com/KiWi233333/git-sync-tui/actions/workflows/publish.yml/badge.svg" alt="publish"></a>
7
+ <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/git-sync-tui.svg?color=8b5cf6" alt="node version"></a>
8
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-f59e0b.svg" alt="license"></a>
9
+ <a href="https://github.com/KiWi233333/git-sync-tui"><img src="https://img.shields.io/github/stars/KiWi233333/git-sync-tui?style=social" alt="GitHub Stars"></a>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <b>Interactive TUI for cross-repository git commit synchronization</b>
14
+ </p>
15
+
16
+ <p align="center">
17
+ Cherry-pick commits from remote branches with an intuitive terminal UI.<br>
18
+ Select specific commits, preview changes, and sync with <code>--no-commit</code> mode for safe review.
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="#-features">Features</a> ·
23
+ <a href="#-quick-start">Quick Start</a> ·
24
+ <a href="#-installation">Installation</a> ·
25
+ <a href="#-workflow">Workflow</a>
26
+ </p>
27
+
28
+ <p align="center">
29
+ <a href="./README.md">English</a> | <a href="./README.zh-CN.md">中文</a>
30
+ </p>
31
+
32
+ <p align="center">
33
+ <img src="./assets/demo.gif" alt="git-sync-tui demo" width="680">
34
+ </p>
35
+
36
+ ## ✨ Features
37
+
38
+ - 🎯 **Multi-select commits** — Cherry-pick non-consecutive commits with Space / Enter
39
+ - 🔍 **Branch search** — Fuzzy filter branches by keyword
40
+ - 👀 **Diff preview** — See `--stat` summary of selected commits before executing
41
+ - ⚡ **Safe mode** — `--no-commit` stages changes for review, never auto-commits
42
+ - ⚠️ **Conflict handling** — Clear display of conflicted files when cherry-pick fails
43
+ - 🌐 **Universal** — Works in any git repository, any language
44
+
45
+ ## 🚀 Quick Start
17
46
 
18
47
  ```bash
48
+ # Install globally
19
49
  npm install -g git-sync-tui
20
- ```
21
50
 
22
- Requires Node.js >= 20.
51
+ # Navigate to your git repo and run
52
+ cd your-project
53
+ git-sync-tui
54
+ ```
23
55
 
24
- ## Usage
56
+ ## 📦 Installation
25
57
 
26
58
  ```bash
27
- # Run in any git repository
28
- git-sync-tui
59
+ npm install -g git-sync-tui
29
60
  ```
30
61
 
31
- ### Workflow
62
+ > **Requirements:** Node.js >= 20
63
+
64
+ ## 🔄 Workflow
32
65
 
33
66
  ```
34
- [Select remote] [Select branch] [Multi-select commits] [Preview stat] → [Confirm] → [Cherry-pick --no-commit] → [Review & commit manually]
67
+ Select Remote Select Branch Multi-select Commits Preview Changes
68
+
69
+ Review & Commit manually ← Cherry-pick --no-commit (staged, not committed)
35
70
  ```
36
71
 
37
- ### Keyboard Shortcuts
72
+ ## ⌨️ Keyboard Shortcuts
38
73
 
39
74
  | Key | Action |
40
75
  |-----|--------|
41
- | `↑` / `↓` | Navigate |
76
+ | `↑` `↓` | Navigate items |
42
77
  | `Space` | Toggle commit selection |
43
78
  | `Enter` | Confirm selection |
44
79
  | `y` / `n` | Confirm / cancel execution |
80
+ | `/` | Search (in branch list) |
45
81
 
46
- ### After sync
82
+ ## 📋 After Sync
47
83
 
48
84
  Changes are staged in your working tree (not committed). You can:
49
85
 
50
86
  ```bash
51
- git diff --cached # Review changes
52
- git commit -m "sync: ..." # Commit when ready
53
- git reset HEAD # Or discard all changes
87
+ # Review staged changes
88
+ git diff --cached
89
+
90
+ # Commit when ready
91
+ git commit -m "sync: cherry-picked commits from feature-branch"
92
+
93
+ # Or discard all changes
94
+ git reset HEAD
54
95
  ```
55
96
 
56
- ## Development
97
+ ## 💡 Use Cases
98
+
99
+ | Scenario | Description |
100
+ |----------|-------------|
101
+ | **Backport fixes** | Cherry-pick critical fixes from main to release branches |
102
+ | **Sync features** | Copy specific commits between feature branches |
103
+ | **Selective merge** | Pick individual commits instead of merging entire branches |
104
+
105
+ ## 🛠️ Development
57
106
 
58
107
  ```bash
59
108
  git clone https://github.com/KiWi233333/git-sync-tui.git
60
109
  cd git-sync-tui
61
110
  npm install
62
- npm start # Run with tsx
63
- npm run build # Build with tsup
111
+ npm start
64
112
  ```
65
113
 
66
- ## License
114
+ ## 🏗️ Tech Stack
115
+
116
+ - [Ink](https://github.com/vadimdemedes/ink) — React for interactive CLI apps
117
+ - [@inkjs/ui](https://github.com/inkjs/ui) — UI components for Ink
118
+ - [simple-git](https://github.com/steveukx/git-js) — Git commands interface
119
+
120
+ ## 🤝 Contributing
121
+
122
+ Contributions are welcome! Please feel free to submit a Pull Request.
123
+
124
+ ## 📄 License
67
125
 
68
- MIT
126
+ [MIT](./LICENSE) © [KiWi233333](https://github.com/KiWi233333)
@@ -0,0 +1,126 @@
1
+ <h1 align="center">🔄 git-sync-tui</h1>
2
+
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/git-sync-tui"><img src="https://img.shields.io/npm/v/git-sync-tui.svg?color=0ea5e9" alt="npm version"></a>
5
+ <a href="https://www.npmjs.com/package/git-sync-tui"><img src="https://img.shields.io/npm/dm/git-sync-tui.svg?color=10b981" alt="downloads"></a>
6
+ <a href="https://github.com/KiWi233333/git-sync-tui/actions/workflows/publish.yml"><img src="https://github.com/KiWi233333/git-sync-tui/actions/workflows/publish.yml/badge.svg" alt="publish"></a>
7
+ <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/git-sync-tui.svg?color=8b5cf6" alt="node version"></a>
8
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-f59e0b.svg" alt="license"></a>
9
+ <a href="https://github.com/KiWi233333/git-sync-tui"><img src="https://img.shields.io/github/stars/KiWi233333/git-sync-tui?style=social" alt="GitHub Stars"></a>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <b>跨仓库 Git 提交同步的交互式 TUI 工具</b>
14
+ </p>
15
+
16
+ <p align="center">
17
+ 通过直观的终端界面从远程分支 cherry-pick 提交。<br>
18
+ 选择特定提交、预览变更,并使用 <code>--no-commit</code> 模式在提交前安全审查。
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="#-功能特性">功能</a> ·
23
+ <a href="#-快速开始">快速开始</a> ·
24
+ <a href="#-安装">安装</a> ·
25
+ <a href="#-工作流程">工作流程</a>
26
+ </p>
27
+
28
+ <p align="center">
29
+ <a href="./README.md">English</a> | <a href="./README.zh-CN.md">中文</a>
30
+ </p>
31
+
32
+ <!-- <p align="center">
33
+ <img src="./assets/demo.gif" alt="git-sync-tui 演示" width="680">
34
+ </p> -->
35
+
36
+ ## ✨ 功能特性
37
+
38
+ - 🎯 **多选提交** — 使用 Space / Enter 选择不连续的提交进行 cherry-pick
39
+ - 🔍 **分支搜索** — 按关键词模糊过滤分支
40
+ - 👀 **差异预览** — 执行前查看所选提交的 `--stat` 摘要
41
+ - ⚡ **安全模式** — `--no-commit` 仅暂存变更供审查,不会自动提交
42
+ - ⚠️ **冲突处理** — cherry-pick 失败时清晰显示冲突文件
43
+ - 🌐 **通用性** — 适用于任何 Git 仓库,不限语言
44
+
45
+ ## 🚀 快速开始
46
+
47
+ ```bash
48
+ # 全局安装
49
+ npm install -g git-sync-tui
50
+
51
+ # 进入你的 Git 仓库并运行
52
+ cd your-project
53
+ git-sync-tui
54
+ ```
55
+
56
+ ## 📦 安装
57
+
58
+ ```bash
59
+ npm install -g git-sync-tui
60
+ ```
61
+
62
+ > **环境要求:** Node.js >= 20
63
+
64
+ ## 🔄 工作流程
65
+
66
+ ```
67
+ 选择远程仓库 → 选择分支 → 多选提交 → 预览变更
68
+
69
+ 手动审查并提交 ← Cherry-pick --no-commit(已暂存,未提交)
70
+ ```
71
+
72
+ ## ⌨️ 快捷键
73
+
74
+ | 按键 | 操作 |
75
+ |-----|------|
76
+ | `↑` `↓` | 上下导航 |
77
+ | `Space` | 切换提交选择 |
78
+ | `Enter` | 确认选择 |
79
+ | `y` / `n` | 确认 / 取消执行 |
80
+ | `/` | 搜索(在分支列表中) |
81
+
82
+ ## 📋 同步后操作
83
+
84
+ 变更已暂存在工作区(未提交)。你可以:
85
+
86
+ ```bash
87
+ # 查看暂存的变更
88
+ git diff --cached
89
+
90
+ # 准备好后提交
91
+ git commit -m "sync: 从 feature-branch cherry-pick 提交"
92
+
93
+ # 或放弃所有变更
94
+ git reset HEAD
95
+ ```
96
+
97
+ ## 💡 使用场景
98
+
99
+ | 场景 | 描述 |
100
+ |------|------|
101
+ | **回溯修复** | 从主分支 cherry-pick 关键修复到发布分支 |
102
+ | **同步特性** | 在特性分支间复制特定提交 |
103
+ | **选择性合并** | 选择单个提交而非合并整个分支 |
104
+
105
+ ## 🛠️ 开发
106
+
107
+ ```bash
108
+ git clone https://github.com/KiWi233333/git-sync-tui.git
109
+ cd git-sync-tui
110
+ npm install
111
+ npm start
112
+ ```
113
+
114
+ ## 🏗️ 技术栈
115
+
116
+ - [Ink](https://github.com/vadimdemedes/ink) — 用于构建交互式 CLI 应用的 React 框架
117
+ - [@inkjs/ui](https://github.com/inkjs/ui) — Ink 的 UI 组件库
118
+ - [simple-git](https://github.com/steveukx/git-js) — Git 命令接口
119
+
120
+ ## 🤝 贡献
121
+
122
+ 欢迎贡献代码!请随时提交 Pull Request。
123
+
124
+ ## 📄 许可证
125
+
126
+ [MIT](./LICENSE) © [KiWi233333](https://github.com/KiWi233333)