@@ -4,14 +4,25 @@ section: "expert-topics"
44order : 6
55---
66
7- ## Overview
7+ ## 1. Overview
88
99This chapter covers power-user topics — configuration layers, revision
1010selectors, pathspec and refspec syntax, interactive rebase, bisect,
1111hooks, and garbage collection. These concepts are not needed for daily
1212Git use but become essential as projects and teams grow.
1313
14- ## Configuration
14+ In this chapter you will learn:
15+
16+ - How Git's layered configuration system works and how to customize it
17+ - How to use revision selectors (tilde, caret, ranges) to navigate commit history
18+ - How pathspec patterns filter files in Git commands
19+ - How refspec syntax maps local and remote references
20+ - How to rewrite commit history with interactive rebase
21+ - How to find the commit that introduced a bug using bisect
22+ - How to automate tasks with Git hooks
23+ - How garbage collection and the reflog protect and clean up orphaned commits
24+
25+ ## 2. Configuration
1526
1627![ Configuration Model] ( ../assets/images/git-configuration-model.png )
1728
@@ -69,7 +80,7 @@ $ git config --list --show-scope # all settings with scope level
6980When the same parameter is set at multiple levels, the most specific
7081wins: local overrides global, global overrides system.
7182
72- ## Revision Selectors
83+ ## 3. Revision Selectors
7384
7485Revision selectors let you reference specific commits without knowing
7586their hashes. They are used with ` git log ` , ` git diff ` , ` git show ` ,
@@ -137,7 +148,7 @@ $ git show "HEAD@{yesterday}" # where HEAD was yesterday
137148$ git show "main@{2.weeks.ago}" # where main was 2 weeks ago
138149```
139150
140- ## Pathspec
151+ ## 4. Pathspec
141152
142153A pathspec is a pattern that matches files or directories. Most Git
143154commands that work with files accept pathspecs.
@@ -175,7 +186,7 @@ Signatures control the matching behavior. Syntax: `:(signature)pattern`
175186
176187Signatures can be combined: ` ':(top,icase)*.mp?' `
177188
178- ## Refspec
189+ ## 5. Refspec
179190
180191When you run ` git fetch ` or ` git push ` , Git needs to know which
181192references on one side map to which references on the other. A refspec
@@ -216,7 +227,7 @@ $ git push origin :refs/heads/feature # delete remote branch (empty src)
216227$ git fetch origin main:refs/remotes/origin/main # fetch one branch explicitly
217228```
218229
219- ## Interactive Rebase
230+ ## 6. Interactive Rebase
220231
221232Interactive rebase lets you edit, reorder, squash, or drop commits
222233before sharing them. It rewrites history — use it only on local
@@ -261,7 +272,7 @@ Result: one commit with a combined message replacing all three.
261272> ** Warning:** Interactive rebase rewrites commit hashes. Never rebase
262273> commits that have already been pushed to a shared branch.
263274
264- ## Git Bisect
275+ ## 7. Git Bisect
265276
266277` git bisect ` performs a binary search through commit history to find
267278the commit that introduced a bug. Instead of checking every commit,
@@ -299,7 +310,7 @@ $ git bisect run ./test.sh
299310Git runs the script at each midpoint automatically and reports the
300311first bad commit when done.
301312
302- ## Hooks
313+ ## 8. Hooks
303314
304315Hooks are scripts that Git runs automatically before or after specific
305316events. They live in ` .git/hooks/ ` and are not tracked by Git (each
@@ -352,7 +363,7 @@ $ git push --no-verify # skip pre-push hook
352363
353364Use sparingly — hooks exist for a reason.
354365
355- ## Garbage Collection
366+ ## 9. Garbage Collection
356367
357368When you reset, rebase, or delete a branch, the commits that were on it
358369don't disappear immediately. They become ** orphaned** — they still exist
0 commit comments