summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-07-30 14:47:26 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-07-31 08:34:01 +0200
commit94daf7bddcbb9c0002325dcd3a3b1bf17b42889e (patch)
tree8d1560dece2e62b19ef1e42759c387c353322072
parent4eb73393bbbbd791dca820bdf0020e71b4347841 (diff)
Add documentation for working with stacked branches
-rw-r--r--docs/README.md1
-rw-r--r--docs/Stacked_Branches.md18
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/README.md b/docs/README.md
index acce8338c..604c8a07a 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -6,4 +6,5 @@
* [Keybindings](./keybindings)
* [Undo/Redo](./Undoing.md)
* [Searching/Filtering](./Searching.md)
+* [Stacked Branches](./Stacked_Branches.md)
* [Dev docs](./dev)
diff --git a/docs/Stacked_Branches.md b/docs/Stacked_Branches.md
new file mode 100644
index 000000000..b73e4aca5
--- /dev/null
+++ b/docs/Stacked_Branches.md
@@ -0,0 +1,18 @@
+# Working with stacked branches
+
+When working on a large branch it can often be useful to break it down into
+smaller pieces, and it can help to create separate branches for each independent
+chunk of changes. For example, you could have one branch for preparatory
+refactorings, one for backend changes, and one for frontend changes. Those
+branches would then all be stacked onto each other.
+
+Git has support for rebasing such a stack as a whole; you can enable it by
+setting the git config `rebase.updateRfs` to true. If you then rebase the
+topmost branch of the stack, the other ones in the stack will follow. This
+includes interactive rebases, so for example amending a commit in the first
+branch of the stack will "just work" in the sense that it keeps the other
+branches properly stacked onto it.
+
+Lazygit visualizes the invidual branch heads in the stack by marking them with a
+cyan asterisk (or a cyan branch symbol if you are using [nerd
+fonts](Config.md#display-nerd-fonts-icons)).