Skip to content

Commit a730539

Browse files
committed
feat(docs)!: update docs
1 parent 1242ace commit a730539

File tree

11 files changed

+90
-209
lines changed

11 files changed

+90
-209
lines changed

README.md

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,63 +6,19 @@ Fast, opinionated version control experience. Powered by [jj-vcs](https://github
66

77
## Goals
88

9-
- Most actions (commit, push, rebase, ...) can be done with a single command, with reasonable default arguments.
10-
- Try my best to make jj compatible with git remote actions (pull, push, create PRs...). Some bookmark actions are annoying, I make them implicit.
11-
- Integrate GitHub workflow into jj, (powered by gh cli).
12-
- Final goal: make a freshman user able to use jj **without any git knowledge**.
9+
- ⚡️ Minimal Commands
1310

14-
MAKE **VERSION CONTROL** GREAT AGAIN!
11+
No more interactive rebases or hard-to-remember Git commands. Do everything with a single command!
1512

16-
## Planned Features
17-
- [x] Clone a repo
18-
- [x] shorthand for github
19-
- [ ] shorthand for your own github repo (powered by gh cli)
20-
- [ ] Fork and clone a repo (powered by gh cli)
21-
- [x] Download a repo (powered by [degit-rs](https://github.com/psnszsn/degit-rs))
22-
- [x] Download specified file / folder (powered by [cloneit](https://github.com/alok8bb/cloneit))
23-
- [x] Initialize a repo
24-
- [x] Create a new repo on GitHub
25-
- [x] Add remote to local repo
26-
- [x] Create a default branch
27-
- [ ] Download a .gitignore
28-
- [x] Commit specified files
29-
- [x] `--push` option
30-
- [ ] Experimental config: allow array message input
31-
- [x] Amend changes
32-
- [x] `--force`: `--ignore-immutable`
33-
- [x] Reset changes
34-
- [x] Push to remote
35-
- [x] If no branch specified, push the closest bookmark
36-
- [x] (for a multi-worker branch) Pull before Push `--pull`
37-
- [x] (for a multi-branch repo) Update trunk `--upbase`
38-
- [x] `--change` option
39-
- [x] Pull from Remote
40-
- [x] Update Trunk from a branch (`upbase`)
41-
- [ ] GitHub PR Create, TBD
42-
- [ ] Consider co-locate with git, to get highest IDE / git-tool compatibility
43-
- [ ] `clone --colocate`
44-
- [ ] `init --colocate`
45-
- [ ] config: check git or not
46-
- [ ] config: use colocate by default or not
47-
- [ ] Record repos that managed by hj, and launch selector if there's no `.jj` in cwd. (?)
48-
- [x] Make `hj keepup` independent
49-
- [ ] closest pushable: [discussion](https://github.com/jj-vcs/jj/discussions/5568#discussioncomment-13007551)
50-
- [x] `hj switch`: `hj keepup`, `hj new` and `git switch`, useful for colocation
51-
- [x] allow shortcuts: `hj main` for `hj switch main`
52-
- [x] `hj all`: same as `hj log -r "all()"`
53-
- [ ] Other log commands, TBD
54-
- [ ] `hj rollback`: interactive rollback, using skim
55-
- [ ] Publish document
13+
- 🛠️ Seamless Integration with Git and Git Forges
5614

15+
Fully compatible with Git-based CLI tools and IDEs, with special optimizations for GitHub workflows!
5716

58-
## Nice ideas that may be added in `hj`
17+
- ⭐️ Beginner Friendly
5918

60-
-[Find the closest bookmark in history to advance it forward](https://github.com/jj-vcs/jj/discussions/5568)
61-
-[Select all my branches with the goal of rebasing them all on the trunk](https://github.com/jj-vcs/jj/discussions/4974)
62-
- [`gh pr create`](https://github.com/jj-vcs/jj/discussions/6279)
63-
- [jj configurations](https://github.com/jj-vcs/jj/discussions/5812)
64-
- [GitHub Integration](https://github.com/jj-vcs/jj/issues/4555)
19+
Get started easily without any knowledge of Git or jj-vcs.
6520

21+
MAKE **VERSION CONTROL** GREAT AGAIN!
6622

6723
## Now you can try hj ...
6824

docs/cn/api-examples.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

docs/cn/branch.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 分支
22

3+
4+
5+
## 分支的「书签」模型
6+
37
:::details 对于熟悉 git 的用户
48

59
hj 中的分支模型和 git 中不同。每次提交(commit)后,hj 不会像 git 一样将分支的头指针指向新的提交;更新分支头指针只会发生在 `hj push``hj switch` 时。
@@ -12,6 +16,8 @@ hj 的分支(书签)模型基于 jj 改进而来。`hj push` 和 `hj switch`
1216

1317
:::
1418

19+
TODO
20+
1521
## 切换分支
1622

1723
:::details 对于熟悉 git 的用户
@@ -48,3 +54,6 @@ hj switch BRANCH
4854
```
4955

5056
来切换到一个分支。
57+
58+
59+

docs/cn/commit.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ hj squash -i --from A --into B
214214

215215
---
216216

217-
## 将提交中的变更拆分为一个提交
217+
## 拆分提交
218218

219219
::: details 对于熟悉 git 的用户
220220

@@ -274,3 +274,33 @@ hj rebase -s A -d B
274274
这将把提交 A 移动到提交 B 之上。
275275

276276
更多用法参见 [jj rebase](https://jj-vcs.github.io/jj/latest/cli-reference/#jj-rebase)
277+
278+
## 删除提交
279+
280+
::: details 对于熟悉 git 的用户
281+
282+
`hj abandon B` 近似于:
283+
284+
```sh
285+
git rebase --onto B^ B
286+
```
287+
288+
特别地,如果 B 是合并提交,`B^`( B 的父提交)可能存在多个。这种情况下你需要显式地指定,否则命令会失败。
289+
290+
:::
291+
292+
::: details 对于熟悉 jj 的用户
293+
294+
`hj abandon``jj abandon` 完全等价。
295+
296+
:::
297+
298+
`abandon` 命令可以用来删除一个提交:
299+
300+
```sh
301+
hj abandon REVSET
302+
```
303+
304+
这将移除这个提交,并将其子提交变基到其父提交上。
305+
306+
特别地,如果不指定 `REVSET`,将默认为工作副本(`@`)。此时会清空工作副本的所有变更,并自动地创建一个新工作副本提交。

docs/cn/faq.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 常见问题
22

3-
## 已经有了 git / jj,为什么还要自己造一个工具?
3+
## 已经有了 git / jj-vcs,为什么还要自己造一个工具?
44

55
[git](https://git-scm.com/) 有着悠久的历史,并且绝大多数开源代码都托管在基于 git 的平台上。几乎不可能撼动 git 的地位。
66

@@ -10,24 +10,24 @@
1010

1111
如果你感兴趣的话,这里有一篇关于 git 的文章:[关于 Git 的礼节](https://www.yinwang.org/blog-cn/2015/03/11/git-etiquette)
1212

13-
[jj](https://github.com/jj-vcs/jj) 是一个革新性的工具,具备了很多新的理念:
13+
[jj-vcs](https://github.com/jj-vcs/jj) 是一个革新性的工具,具备了很多新的理念:
1414

1515
- 工作副本(工作区)也是一个提交。这样不需要 stash,而且切换分支和变基永远不会失败。
16-
- 不需要索引区(index / staging),所有变更默认被提交,也包括 git 中的未追踪文件。
16+
- 不需要索引区(暂存区),所有变更默认被提交,也包括 git 中的未追踪文件。
1717
- 不再需要交互式变基,子提交会被自动变基。
1818
- 使用函数式语言指定文件和变更,而不是使用上古时期的方式解析文本。
1919
- 有着默认的根提交。
2020
- ……
2121

2222
这些理念上的革新使得 jj 的本地版本控制非常优秀。
2323

24-
但是 jj 在与 git 远程的互作性上有待进步。例如书签(分支 HEAD)并不会随着提交而推进;pull / push 的模型依然需要非常熟练才能掌握。
24+
但是 jj 在与 git 远程的互作性上有待进步。例如书签(分支 HEAD)并不会随着提交而推进;pull / push 的模型依然需要非常熟练才能掌握。jj 与 Git Forge(如 GitHub)的互作性也不够好。
2525

26-
而且 jj 是另一套工具,依然有着不小的学习成本
26+
而且 jj 是另一套工具和使用理念,不论你是否学过 Git 都有着不小的学习成本
2727

2828
所以有了 hj,致力于基于 jj 的优秀理念,提供一个 90% 场景下极简的版本控制体验,降低你的学习成本(你甚至可以在不了解 git 和 jj 的情况下上手),并且在一些特殊场景中你可以随时切换回 jj 进行操作。
2929

30-
让我们来举几个例子说明 hj 的极简性:
30+
让我们来举几个例子说明 hj 相较于 jj 的极简性:
3131

3232
- 你可以一行命令开始版本控制、新建一个默认的主分支、创建一个 GitHub 仓库、并把远程仓库关联到本地:
3333

@@ -53,8 +53,19 @@ hj 将不断进步!💪🏻
5353

5454
- `hj undo` 是基于 `jj undo` 的。而 hj 的很多操作不是原子化的,例如 `hj switch` 内部执行了两行 jj 命令,所以 `hj undo` 不能够完全撤销一个操作。未来我们会根据 `hj op restore` 封装一个命令。
5555

56-
- 因为 hj 基于 jj,所以短期内几乎不可能实现各种 IDE 或插件的适配(因为 jj 的知名度远远不够)。如果你非常需要这些适配的话,可以考虑 [与 Git 仓库共存](/init.html#与-git-仓库共存)
56+
- 因为 hj 基于 jj,所以短期内几乎不可能实现各种 IDE 或插件的原生适配(因为 jj 的知名度远远不够)。如果你非常需要这些适配的话,可以考虑 [与 Git 仓库共存](/cn/init.html#与-git-仓库共存)
5757

5858
- hj 的很多改变工作副本指向的操作不会自动推进书签。这是 jj 的特意设计,hj 正在尝试解决。
5959

6060
- hj 还没有发布各架构的 Release。现在你仅能通过 `cargo install --path .` 来安装。
61+
62+
## 路线图
63+
64+
- 🚧 涉及 `gh` CLI 的命令支持省略 `owner`,默认为当前登录的用户。
65+
- 🚧 `hj clone --fork`
66+
- 🚧 `hj download` 下载单个文件(夹) 时直接下载到指定的目录,而不包含远程仓库中的文件夹结构。
67+
- 🚧 `hj init` 时支持下载 `.gitignore`。([来源](https://github.com/github/gitignore)
68+
- 🚧 全面支持 GitLab。
69+
- 🚧 `hj commit``hj describe` 时支持打开编辑器进行多行描述的编辑。
70+
- 🚧 `hj rollback`:交互式选择要回退的命令。
71+
- 🚧 优化与 Git 仓库共存时的体验。

docs/cn/index.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,28 @@ layout: home
55
hero:
66
name: "hj"
77
text: ""
8-
tagline: Fast, opinionated version control experience.
8+
tagline: 易用的版本控制工具。
99
actions:
1010
- theme: brand
11-
text: Markdown Examples
12-
link: /markdown-examples
11+
text: 快速上手
12+
link: /cn/init
1313
- theme: alt
14-
text: API Examples
15-
link: /api-examples
14+
text: 为什么选择 hj
15+
link: /cn/faq
1616

1717
features:
18-
- title: Feature A
19-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20-
- title: Feature B
21-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22-
- title: Feature C
23-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
18+
- title: ⚡️ 极简的命令
19+
details: 不再使用交互式变基和难记的 Git 命令,一行命令实现所有操作!
20+
- title: 🛠️ 与 Git 和 Git Forge 完美集成
21+
details: 兼容基于 Git 的命令行工具和 IDE,针对 GitHub 工作流特别优化!
22+
- title: ⭐️ 新手友好
23+
details: 在不了解 Git 和 jj-vcs 的情况下轻松上手。
2424
---
2525

26+
<style module>
27+
h1 > span {
28+
font-family: monospace;
29+
}
30+
31+
32+
</style>

docs/cn/init.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jj bookmark set main
4242
hj init --github
4343
```
4444

45-
这将调用本地的命令行工具 [gh](https://cli.github.com/) 来创建一个新的 GitHub 仓库,并将其设置为远程 origin 仓库。仓库默认以 **当前目录名** 命名,并为公开仓库(可以额外传递参数 `--private` 来创建私有仓库)。
45+
这将调用本地的命令行工具 [gh](https://cli.github.com/) 来创建一个新的 GitHub 仓库,并将其设置为远程名为 `origin` 的仓库。仓库默认以 **当前目录名** 命名,并为公开仓库(可以额外传递参数 `--private` 来创建私有仓库)。
4646

4747
:::tip
4848

@@ -85,10 +85,10 @@ hj open
8585
另外,你可以使用:
8686

8787
```sh
88-
hj open REMOTE
88+
hj open REMOTE # 默认的远程名是 origin
8989
```
9090

91-
来使用默认的浏览器打开远程仓库的网页地址,例如最常见远程名是 `origin`
91+
来使用默认的浏览器打开远程仓库的网页地址。
9292

9393

9494
<!-- 运行:

docs/cn/markdown-examples.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

docs/cn/repo-status.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)