Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 088c7fe

Browse files
authored
Document how to ignore specific files in a diff (#1668)
1 parent 297817b commit 088c7fe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/git.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,18 @@ See [the docs for `--color-moved`](https://git-scm.com/docs/git-diff#Documentati
508508
See [the relevant section for PR authors](#git-range-diff). This can be useful for comparing code
509509
that was force-pushed to make sure there are no unexpected changes.
510510

511+
### Ignoring changes to specific files
512+
513+
Many large files in the repo are autogenerated. To view a diff that ignores changes to those files,
514+
you can use the following syntax (e.g. Cargo.lock):
515+
516+
```
517+
git log -p ':!Cargo.lock'
518+
```
519+
520+
Arbitrary patterns are supported (e.g. `:!compiler/*`). Patterns use the same syntax as
521+
`.gitignore`, with `:` prepended to indicate a pattern.
522+
511523
## Git submodules
512524

513525
**NOTE**: submodules are a nice thing to know about, but it *isn't* an absolute

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /