You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add --skip and robustness features to README and CHANGELOG
- Document --skip flag in command options, examples, and conflict
handling sections of README
- Add external abort detection and chain validation to README
- Update recovery options to include --skip
- Add Phase 2 entries to CHANGELOG
Copy file name to clipboardExpand all lines: README.md
+35-7Lines changed: 35 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,12 @@ Git Chain's rebase command offers customization through its flags:
106
106
```
107
107
After resolving a rebase conflict and completing the git-level rebase (`git rebase --continue`), use this to continue rebasing the remaining branches in the chain. Uses saved merge bases from the original run.
108
108
109
+
-**`--skip`**: Skip the current conflicted branch and continue with the rest of the chain
110
+
```
111
+
git chain rebase --skip
112
+
```
113
+
When a rebase conflict occurs and you don't want to resolve it, use `--skip` to restore the conflicted branch to its original position and continue rebasing the remaining branches. This aborts any in-progress git rebase automatically.
114
+
109
115
-**`--abort`**: Abort a chain rebase and restore all branches
110
116
```
111
117
git chain rebase --abort
@@ -171,6 +177,11 @@ git rebase --continue
171
177
git chain rebase --continue
172
178
```
173
179
180
+
Or if you want to skip the conflicted branch and continue with the rest:
181
+
```
182
+
git chain rebase --skip
183
+
```
184
+
174
185
Or if you want to abort the entire chain rebase and restore all branches:
175
186
```
176
187
git chain rebase --abort
@@ -194,7 +205,7 @@ When rebasing branches in a chain, conflicts can sometimes occur. Git Chain save
194
205
- Pauses the rebasing process at the conflicted commit
195
206
- Saves the chain rebase state (original branch refs, merge bases, per-branch status)
196
207
- Leaves the repository in a conflicted state for you to resolve
197
-
- Provides numbered recovery steps with `--continue` and `--abort` instructions
208
+
- Provides numbered recovery steps with `--continue`, `--skip`, and `--abort` instructions
198
209
199
210
2.**Resolution Process**:
200
211
- The conflicted files will be marked with conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`)
@@ -210,13 +221,25 @@ When rebasing branches in a chain, conflicts can sometimes occur. Git Chain save
210
221
- Git Chain loads the saved state and continues rebasing the remaining branches using pre-computed merge bases
211
222
- After all branches are rebased, the state file is cleaned up and you are returned to your original branch
212
223
213
-
4.**Aborting a Problematic Rebase**:
214
-
- If you decide not to resolve the conflicts, abort the entire chain rebase:
224
+
4.**Skipping a Problematic Branch**:
225
+
- If you don't want to resolve the conflict for a particular branch, skip it and continue:
226
+
```
227
+
git chain rebase --skip
228
+
```
229
+
- This aborts the in-progress git rebase, restores the conflicted branch to its original position, and continues rebasing the remaining branches
230
+
231
+
5.**Aborting the Entire Chain Rebase**:
232
+
- If you decide to cancel the entire chain rebase and restore all branches:
215
233
```
216
234
git chain rebase --abort
217
235
```
218
236
- This restores all branches to their original positions, aborts any in-progress git rebase, and cleans up the state file
219
237
238
+
6.**External Abort Detection**:
239
+
- If you run `git rebase --abort` directly (bypassing git-chain), git-chain detects this when you run `--continue`
240
+
- It compares the branch's current commit with the saved original ref to determine if the rebase was aborted externally
241
+
- You'll be prompted to use `--skip` to skip the branch or `--abort` to cancel the entire chain rebase
If a rebase goes wrong, Git Chain provides several recovery options:
243
266
244
-
1.**Abort Chain Rebase**: If a chain rebase is in progress (state file exists), abort and restore all branches:
267
+
1.**Skip Conflicted Branch**: Skip the branch that has conflicts and continue with the rest of the chain:
268
+
```
269
+
git chain rebase --skip
270
+
```
271
+
272
+
2.**Abort Chain Rebase**: If a chain rebase is in progress (state file exists), abort and restore all branches:
245
273
```
246
274
git chain rebase --abort
247
275
```
248
276
249
-
2.**Backup Branches**: Backup branches are automatically created when squash-merged branches are reset (via `--squashed-merge=reset`). You can also create backups manually with `git chain backup`. To restore:
277
+
3.**Backup Branches**: Backup branches are automatically created when squash-merged branches are reset (via `--squashed-merge=reset`). You can also create backups manually with `git chain backup`. To restore:
250
278
```
251
279
git checkout branch-name
252
280
git reset --hard backup-chain-name/branch-name
253
281
```
254
282
255
-
3.**Reflog**: Even without backups, you can recover using Git's reflog:
283
+
4.**Reflog**: Even without backups, you can recover using Git's reflog:
256
284
```
257
285
git checkout branch-name
258
286
git reflog
259
287
git reset --hard branch-name@{1} # Reset to previous state
260
288
```
261
289
262
-
4.**Abort Git-Level Rebase**: If only the git-level rebase needs aborting (before using `--abort`):
290
+
5.**Abort Git-Level Rebase**: If only the git-level rebase needs aborting (before using `--abort`):
0 commit comments