Skip to content

Commit c663b26

Browse files
committed
docs: update readme
1 parent f22c503 commit c663b26

File tree

2 files changed

+49
-138
lines changed

2 files changed

+49
-138
lines changed

README.md

Lines changed: 25 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,121 +2,76 @@
22

33
[🇨🇳 中文文档](./README.zh.md) | [🇺🇸 English](./README.en.md)
44

5-
**gix** is a Git extension CLI tool designed to simplify common Git workflows like commit merging and force pushing. Built with TypeScript, it is extensible, interactive, and ready for automation.
5+
**gix** is a Git extension CLI tool designed to simplify your Git workflows — especially for merging commits and force pushing, with safety and clarity.
66

77
---
88

99
## 🚀 Features
1010

1111
- 🔧 Interactively merge multiple Git commits
12-
- 💬 Customize commit message
13-
- 🚦 Optional force-push confirmation (enabled by default)
14-
- 🧱 Fully typed TypeScript support
15-
- 🔌 Easy to extend with commands like `undo`, `squash`, etc.
12+
- 💬 Custom commit message input
13+
- 🚦 Confirm force push automatically
14+
- 🧱 Fully typed, powered by TypeScript
15+
- 🔌 Modular command system — more to come
1616

1717
---
1818

1919
## 📦 Installation
2020

21-
### ✅ Option 1: Install via npm (Recommended for most users)
22-
2321
```bash
2422
npm install -g gix
2523
```
2624

27-
Then simply run:
25+
Then use it globally:
2826

2927
```bash
3028
gix merge
3129
```
3230

33-
Use this for quickly merging commits in daily development workflows.
34-
3531
---
3632

37-
### 🛠 Option 2: Clone the repo and develop locally (For contributors/devs)
33+
## 🛠 Usage Examples
3834

39-
```bash
40-
git clone https://github.com/nianyi778/gix-cli.git
41-
cd gix
42-
pnpm install
43-
pnpm build
44-
pnpm link
45-
```
46-
47-
Then you can use the CLI globally:
35+
### Merge commits
4836

4937
```bash
5038
gix merge
5139
```
5240

53-
#### If you encounter a `pnpm link` error (ERR_PNPM_NO_GLOBAL_BIN_DIR):
41+
Follow the prompts to:
42+
- Select start and end commits
43+
- Write a new commit message
44+
- Optionally force-push
45+
46+
Or directly:
5447

5548
```bash
56-
pnpm setup
57-
source ~/.zshrc # Or restart your terminal
49+
gix merge -f <from> -m "your message"
5850
```
5951

60-
---
61-
62-
## 🧪 Usage Example
52+
### Squash commits
6353

6454
```bash
65-
gix merge
55+
gix squash -n 3 # squash last 3 commits
6656
```
6757

68-
You will be prompted to enter:
69-
70-
- ✅ Start commit hash (required)
71-
- ✅ End commit hash (optional, default is HEAD)
72-
- ✅ New commit message
73-
- ✅ Whether to force push (default is yes)
74-
75-
### Direct command-line usage:
76-
7758
```bash
78-
gix merge -f a1b2c3d -m "feat: optimize printer logic"
59+
gix squash --all # squash all history from root
7960
```
8061

81-
---
82-
83-
## 📄 Available Commands
84-
85-
- `gix merge`: Merge multiple commits and optionally force-push
86-
87-
### Coming soon
88-
89-
- `gix squash`: Interactively squash recent commits
90-
- `gix undo`: Revert the last merge/reset
91-
- `gix log`: Print formatted commit log history
92-
93-
---
94-
95-
## 👨‍💻 Development
62+
### Check your Git state
9663

9764
```bash
98-
pnpm dev # Dev mode (ts-node + esm loader)
99-
pnpm build # Build output using tsup
65+
gix doctor
10066
```
10167

102-
---
103-
104-
## 📦 Publish
105-
106-
1. Bump version: `npm version patch | minor | major`
107-
2. Build output: `pnpm build`
108-
3. Login to npm: `npm login`
109-
4. Publish: `npm publish`
110-
111-
---
112-
113-
## ✨ Badges
114-
115-
![npm](https://img.shields.io/npm/v/gix?style=flat-square)
116-
![license](https://img.shields.io/npm/l/gix?style=flat-square)
68+
- Check git & node version
69+
- Git repo state
70+
- Working directory clean?
71+
- Remote & branch info
11772

11873
---
11974

12075
## 📄 License
12176

122-
MIT © 2025 [License](./LICENSE)
77+
MIT © 2025 [Nian Yi](./LICENSE)

README.zh.md

Lines changed: 24 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,121 +2,77 @@
22

33
[🇨🇳 中文文档](./README.zh.md) | [🇺🇸 English](./README.en.md)
44

5-
**gix** 是一个 Git 扩展命令行工具,旨在简化 Git 常见操作,如合并多个提交、自动强推等。基于 TypeScript 构建,具有良好的可扩展性和交互体验
5+
**gix** 是一个 Git 扩展命令行工具,专为合并提交、强推等 Git 流程优化而设计,提供交互式体验和类型安全支持
66

77
---
88

99
## 🚀 功能特性
1010

1111
- 🔧 交互式合并多个 Git 提交
1212
- 💬 自定义提交信息
13-
- 🚦 自动强推前进行确认提示(默认开启)
13+
- 🚦 自动确认是否强推(默认开启)
1414
- 🧱 使用 TypeScript 编写,类型安全
15-
- 🔌 易于扩展更多命令(如 `undo``squash` 等)
15+
- 🔌 命令模块化设计,易于扩展
1616

1717
---
1818

1919
## 📦 安装方式
2020

21-
### ✅ 方式一:通过 npm 全局安装(推荐普通用户使用)
22-
2321
```bash
2422
npm install -g gix
2523
```
2624

27-
安装后,你可以直接运行
25+
安装后即可全局使用
2826

2927
```bash
3028
gix merge
3129
```
3230

33-
适合日常开发中快速合并 commit 的使用场景。
34-
3531
---
3632

37-
### 🛠 方式二:克隆源码并本地开发(适合贡献者/开发者)
38-
39-
```bash
40-
git clone https://github.com/nianyi778/gix-cli.git
41-
cd gix
42-
pnpm install
43-
pnpm build
44-
pnpm link
45-
```
33+
## 🛠 使用示例
4634

47-
然后你可以全局使用:
35+
### 合并提交
4836

4937
```bash
5038
gix merge
5139
```
5240

53-
#### 如果遇到 `pnpm link` 报错(ERR_PNPM_NO_GLOBAL_BIN_DIR):
41+
交互输入:
42+
- 起始和结束 commit(可选)
43+
- 新的 commit 信息
44+
- 是否强推
45+
46+
或直接命令行执行:
5447

5548
```bash
56-
pnpm setup
57-
source ~/.zshrc # 或重启终端
49+
gix merge -f <from> -m "你的提交信息"
5850
```
5951

60-
---
61-
62-
## 🛠 使用示例
52+
### 压缩提交(Squash)
6353

6454
```bash
65-
gix merge
55+
gix squash -n 3 # 合并最近 3 次提交
6656
```
6757

68-
将提示你输入:
69-
70-
- ✅ 起始提交 hash(必填)
71-
- ✅ 结束提交 hash(可选,默认 HEAD)
72-
- ✅ 新的提交信息
73-
- ✅ 是否自动强推(默认是)
74-
75-
### 命令行参数方式:
76-
7758
```bash
78-
gix merge -f a1b2c3d -m "feat: 优化打印逻辑"
59+
gix squash --all # 从第一个提交开始合并(全量 squash)
7960
```
8061

81-
---
82-
83-
## 📄 可用命令
84-
85-
- `gix merge`:合并多个提交并可选择强推
86-
87-
### 即将支持
88-
89-
- `gix squash`:自动合并最近多个提交
90-
- `gix undo`:撤销上次 merge/reset 操作
91-
- `gix log`:输出合并历史日志
92-
93-
---
94-
95-
## 👨‍💻 开发指南
62+
### 检查当前 Git 状态
9663

9764
```bash
98-
pnpm dev # 开发模式(使用 ts-node + esm loader)
99-
pnpm build # 使用 tsup 构建产物
65+
gix doctor
10066
```
10167

102-
---
103-
104-
## 📦 发布说明
105-
106-
1. 更新版本号:`npm version patch | minor | major`
107-
2. 构建产物:`pnpm build`
108-
3. 登录 npm:`npm login`
109-
4. 发布包:`npm publish`
110-
111-
---
112-
113-
## ✨ 徽章展示
114-
115-
![npm](https://img.shields.io/npm/v/gix?style=flat-square)
116-
![license](https://img.shields.io/npm/l/gix?style=flat-square)
68+
- 检查 Git 和 Node 版本
69+
- 当前是否为 Git 仓库
70+
- 工作区是否干净
71+
- 是否配置远程仓库
72+
- 当前所在分支
11773

11874
---
11975

12076
## 📄 License
12177

122-
MIT © 2025 [License](./LICENSE)
78+
MIT © 2025 [Nian Yi](./LICENSE)

0 commit comments

Comments
 (0)