oh-my-worktree 0.8.4 → 0.10.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.
- package/README.md +136 -64
- package/bin/owt +1 -1
- package/install.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,110 +1,182 @@
|
|
|
1
1
|
# owt (oh-my-worktree)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[한국어](./README.ko.md) | [English](./README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A fast terminal UI for developers who use Git branches as working contexts, not bookmarks.
|
|
6
|
+
|
|
7
|
+
<img width="786" height="580" alt="Image" src="./owt.png" />
|
|
8
|
+
|
|
9
|
+
## Why owt exists
|
|
10
|
+
|
|
11
|
+
Modern development rarely happens on one branch at a time. You might be reviewing a PR, testing a hotfix, keeping a long-running feature open, and checking main before a release. Plain `git switch` makes that workflow expensive because every context switch drags along uncommitted files, dependencies, editor state, and mental state.
|
|
12
|
+
|
|
13
|
+
Git worktrees solve the underlying problem. `owt` makes them easy enough to use every day.
|
|
14
|
+
|
|
15
|
+
Open `owt`, pick a worktree, create another one, delete the stale ones, fetch, pull, push, or merge without remembering the exact Git incantation. It works from a normal repository and from the `.bare` layout if you prefer keeping all worktrees side by side.
|
|
16
|
+
|
|
17
|
+
## What you get
|
|
18
|
+
|
|
19
|
+
- A keyboard-first TUI for browsing and managing worktrees
|
|
20
|
+
- First-class support for existing regular repositories
|
|
21
|
+
- Optional `.bare` project layout for teams that like sibling worktrees
|
|
22
|
+
- Fast worktree creation from local or remote branches
|
|
23
|
+
- Dirty-state, ahead/behind, last-commit, and GitHub PR status visibility
|
|
24
|
+
- Built-in fetch, pull, push, upstream merge, branch merge, editor open, terminal open, and path copy
|
|
25
|
+
- Shell integration so `Enter` can move your shell into the selected worktree
|
|
26
|
+
|
|
27
|
+
## Install
|
|
6
28
|
|
|
7
29
|
```bash
|
|
8
30
|
npm install -g oh-my-worktree
|
|
9
31
|
```
|
|
10
32
|
|
|
11
|
-
Or
|
|
33
|
+
Or run it without installing:
|
|
12
34
|
|
|
13
35
|
```bash
|
|
14
36
|
npx oh-my-worktree
|
|
15
37
|
```
|
|
16
38
|
|
|
17
|
-
|
|
39
|
+
From source:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/dding-g/oh-my-worktree.git
|
|
43
|
+
cd oh-my-worktree
|
|
44
|
+
cargo build --release
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Start from the repo you already have
|
|
48
|
+
|
|
49
|
+
You do not need to convert your repository.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cd ~/src/my-app
|
|
53
|
+
owt
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
In a regular repository, new worktrees are created under:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
~/.owt/worktree/<repo-name>/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Set `worktree_root` if you want them somewhere else.
|
|
63
|
+
|
|
64
|
+
## Or start with a `.bare` workspace
|
|
65
|
+
|
|
66
|
+
If you like all worktrees living inside one project folder, use `owt clone`.
|
|
18
67
|
|
|
19
68
|
```bash
|
|
20
|
-
# Clone a repository as bare with first worktree
|
|
21
69
|
owt clone https://github.com/user/repo.git
|
|
22
70
|
cd repo/main
|
|
71
|
+
owt
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
That creates a layout like this:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
repo/
|
|
78
|
+
├── .bare/
|
|
79
|
+
├── main/
|
|
80
|
+
├── feature-login/
|
|
81
|
+
└── hotfix-api/
|
|
82
|
+
```
|
|
23
83
|
|
|
24
|
-
|
|
84
|
+
`owt init` prints a conversion guide if you want to move an existing repository into this layout manually.
|
|
85
|
+
|
|
86
|
+
## Daily workflow
|
|
87
|
+
|
|
88
|
+
```bash
|
|
25
89
|
owt
|
|
26
90
|
```
|
|
27
91
|
|
|
28
|
-
|
|
92
|
+
Then use the TUI:
|
|
29
93
|
|
|
30
|
-
### Navigation
|
|
31
|
-
| Key | Action |
|
|
32
|
-
|-----|--------|
|
|
33
|
-
| `j` / `↓` | Move down |
|
|
34
|
-
| `k` / `↑` | Move up |
|
|
35
|
-
| `g` | Jump to current worktree |
|
|
36
|
-
| `gg` | Jump to top |
|
|
37
|
-
| `G` | Jump to bottom |
|
|
38
|
-
| `/` | Search/filter |
|
|
39
|
-
|
|
40
|
-
### Worktree Actions
|
|
41
|
-
| Key | Action |
|
|
42
|
-
|-----|--------|
|
|
43
|
-
| `Enter` | Enter selected worktree |
|
|
44
|
-
| `a` | Add new worktree |
|
|
45
|
-
| `d` | Delete worktree |
|
|
46
|
-
| `o` | Open in editor |
|
|
47
|
-
| `t` | Open in terminal |
|
|
48
|
-
| `y` | Copy path to clipboard |
|
|
49
|
-
|
|
50
|
-
### Other
|
|
51
94
|
| Key | Action |
|
|
52
|
-
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `j` / `k` | Move selection |
|
|
97
|
+
| `Enter` | Enter the selected worktree |
|
|
98
|
+
| `a` | Add a worktree |
|
|
99
|
+
| `d` | Delete a worktree |
|
|
53
100
|
| `f` | Fetch remotes |
|
|
54
|
-
| `
|
|
101
|
+
| `p` / `P` | Pull / push |
|
|
102
|
+
| `m` / `M` | Merge upstream / merge selected branch |
|
|
103
|
+
| `o` / `t` | Open in editor / terminal |
|
|
104
|
+
| `y` | Copy path |
|
|
105
|
+
| `/` | Filter |
|
|
55
106
|
| `s` | Cycle sort mode |
|
|
56
|
-
| `c` |
|
|
57
|
-
| `?` |
|
|
107
|
+
| `c` | View config |
|
|
108
|
+
| `?` | Help |
|
|
58
109
|
| `q` | Quit |
|
|
59
110
|
|
|
60
|
-
##
|
|
111
|
+
## What the list tells you
|
|
61
112
|
|
|
62
|
-
|
|
113
|
+
| Signal | Meaning |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `✓ clean` | No local changes |
|
|
116
|
+
| `+ staged` | Staged changes |
|
|
117
|
+
| `~ unstaged` | Unstaged changes |
|
|
118
|
+
| `! conflict` | Merge conflict |
|
|
119
|
+
| `* mixed` | Staged and unstaged changes |
|
|
120
|
+
| `↑N` / `↓N` | Ahead / behind upstream |
|
|
121
|
+
| `PR` | GitHub PR state: `open`, `closed`, `merged`, `draft`, or `-` |
|
|
63
122
|
|
|
64
|
-
|
|
65
|
-
|-----|------|------|
|
|
66
|
-
| `f` | feature | develop |
|
|
67
|
-
| `h` | hotfix | main |
|
|
68
|
-
| `r` | release | develop |
|
|
69
|
-
| `b` | bugfix | develop |
|
|
70
|
-
| `c` | custom | (select manually) |
|
|
123
|
+
The `PR` column is GitHub-only and best-effort. No PR, non-GitHub remotes, missing auth, network failures, and unknown states all show `-` so the worktree list stays fast and reliable.
|
|
71
124
|
|
|
72
|
-
|
|
73
|
-
- `Shift+F` - Fetch remote base branch
|
|
74
|
-
- `Shift+U` - Use remote as base
|
|
75
|
-
- `Shift+L` - Use local as base
|
|
125
|
+
## Shell integration
|
|
76
126
|
|
|
77
|
-
|
|
127
|
+
Install the shell helper:
|
|
78
128
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
| `!` | Conflicts |
|
|
85
|
-
| `*` | Staged + Unstaged |
|
|
129
|
+
```bash
|
|
130
|
+
owt setup
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Reload your shell. After that, pressing `Enter` in the TUI exits `owt` and moves the current shell into the selected worktree. Without shell integration, `owt` still prints the selected path for wrapper scripts and manual use.
|
|
86
134
|
|
|
87
135
|
## Configuration
|
|
88
136
|
|
|
89
|
-
Config file:
|
|
137
|
+
Config file:
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
~/.config/owt/config.toml
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Example:
|
|
90
144
|
|
|
91
145
|
```toml
|
|
92
146
|
editor = "code"
|
|
93
147
|
terminal = "Ghostty"
|
|
148
|
+
worktree_root = "~/.owt/worktree"
|
|
94
149
|
copy_files = [".env", ".envrc"]
|
|
95
|
-
|
|
96
|
-
[[branch_types]]
|
|
97
|
-
name = "feature"
|
|
98
|
-
prefix = "feature/"
|
|
99
|
-
base = "develop"
|
|
100
|
-
shortcut = "f"
|
|
150
|
+
run_post_add_script_in_tmux = false
|
|
101
151
|
```
|
|
102
152
|
|
|
153
|
+
Useful options:
|
|
154
|
+
|
|
155
|
+
| Option | Purpose |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `editor` | Command used by `o` |
|
|
158
|
+
| `terminal` | Terminal app used by `t` |
|
|
159
|
+
| `worktree_root` | Root for new worktrees in regular repositories |
|
|
160
|
+
| `copy_files` | Files copied into new worktrees |
|
|
161
|
+
| `run_post_add_script_in_tmux` | Run `.owt/post-add.sh` in detached tmux after creating a worktree |
|
|
162
|
+
|
|
163
|
+
## Commands
|
|
164
|
+
|
|
165
|
+
| Command | Purpose |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| `owt [PATH]` | Open the TUI for a repository or worktree |
|
|
168
|
+
| `owt clone <URL> [PATH]` | Clone into the `.bare` layout and create the first worktree |
|
|
169
|
+
| `owt init` | Print a manual conversion guide for `.bare` layout |
|
|
170
|
+
| `owt setup` | Install shell integration |
|
|
171
|
+
| `owt --version` | Print version |
|
|
172
|
+
|
|
103
173
|
## Requirements
|
|
104
174
|
|
|
105
|
-
- Git 2.5+
|
|
106
|
-
- A
|
|
175
|
+
- Git 2.5+
|
|
176
|
+
- A regular Git repository or a `.bare` worktree layout
|
|
177
|
+
- Optional: GitHub CLI `gh` for PR status
|
|
178
|
+
- Optional: tmux for post-add setup scripts
|
|
107
179
|
|
|
108
|
-
##
|
|
180
|
+
## License
|
|
109
181
|
|
|
110
|
-
|
|
182
|
+
MIT
|
package/bin/owt
CHANGED
|
@@ -4,7 +4,7 @@ const { spawn } = require('child_process');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
|
|
7
|
-
const binName = process.platform === 'win32' ? 'owt.exe' : 'owt';
|
|
7
|
+
const binName = process.platform === 'win32' ? 'owt-bin.exe' : 'owt-bin';
|
|
8
8
|
const binPath = path.join(__dirname, binName);
|
|
9
9
|
|
|
10
10
|
if (!fs.existsSync(binPath)) {
|
package/install.js
CHANGED
|
@@ -108,7 +108,7 @@ async function install() {
|
|
|
108
108
|
const binaryName = getPlatform();
|
|
109
109
|
const version = getPackageVersion();
|
|
110
110
|
const binDir = path.join(__dirname, 'bin');
|
|
111
|
-
const binPath = path.join(binDir, BINARY_NAME + (process.platform === 'win32' ? '.exe' : ''));
|
|
111
|
+
const binPath = path.join(binDir, BINARY_NAME + '-bin' + (process.platform === 'win32' ? '.exe' : ''));
|
|
112
112
|
|
|
113
113
|
// Create bin directory
|
|
114
114
|
if (!fs.existsSync(binDir)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-worktree",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A TUI tool for managing Git worktrees in bare
|
|
3
|
+
"version": "0.10.3",
|
|
4
|
+
"description": "A TUI tool for managing Git worktrees in bare and regular repositories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"git",
|
|
7
7
|
"worktree",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/dding-g/oh-my-worktree"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://
|
|
23
|
+
"homepage": "https://dding-g.github.io/oh-my-worktree/",
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/dding-g/oh-my-worktree/issues"
|
|
26
26
|
},
|