Skip to content

Commit ebbe005

Browse files
committed
Add documentation for working with stacked branches
1 parent c1887ce commit ebbe005

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
* [Keybindings](./keybindings)
77
* [Undo/Redo](./Undoing.md)
88
* [Searching/Filtering](./Searching.md)
9+
* [Stacked Branches](./Stacked_Branches.md)
910
* [Dev docs](./dev)

docs/Stacked_Branches.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Working with stacked branches
2+
3+
When working on a large branch it can often be useful to break it down into
4+
smaller pieces, and it can help to create separate branches for each independent
5+
chunk of changes. For example, you could have one branch for preparatory
6+
refactorings, one for backend changes, and one for frontend changes. Those
7+
branches would then all be stacked onto each other.
8+
9+
Git has support for rebasing such a stack as a whole; you can enable it by
10+
setting the git config `rebase.updateRfs` to true. If you then rebase the
11+
topmost branch of the stack, the other ones in the stack will follow. This
12+
includes interactive rebases, so for example amending a commit in the first
13+
branch of the stack will "just work" in the sense that it keeps the other
14+
branches properly stacked onto it.
15+
16+
Lazygit visualizes the invidual branch heads in the stack by marking them with a
17+
cyan asterisk (or a cyan branch symbol if you are using [nerd
18+
fonts](Config.md#display-nerd-fonts-icons)).

0 commit comments

Comments
 (0)