Skip to content

Commit 303abb5

Browse files
committed
Fix non-recursive gitignore files patterns ("/foo")
1 parent a113612 commit 303abb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

book/02-git-basics/sections/recording-changes.asc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ The rules for the patterns you can put in the `.gitignore` file are as follows:
205205

206206
* Blank lines or lines starting with `#` are ignored.
207207
* Standard glob patterns work.
208+
* You can start patterns with a forward slash (`/`) to avoid recursivity.
208209
* You can end patterns with a forward slash (`/`) to specify a directory.
209210
* You can negate a pattern by starting it with an exclamation point (`!`).
210211

@@ -222,7 +223,7 @@ Here is another example .gitignore file:
222223
# but do track lib.a, even though you're ignoring .a files above
223224
!lib.a
224225
225-
# only ignore the root TODO file, not subdir/TODO
226+
# only ignore the TODO file in the current directory, not subdir/TODO
226227
/TODO
227228
228229
# ignore all files in the build/ directory

0 commit comments

Comments
 (0)