Skip to content

Instantly share code, notes, and snippets.

@wenijinew
Last active March 2, 2023 06:29
Show Gist options
  • Save wenijinew/d0dff8948c13f75547365b265bd7e315 to your computer and use it in GitHub Desktop.
Save wenijinew/d0dff8948c13f75547365b265bd7e315 to your computer and use it in GitHub Desktop.
Git Ignore Patterns
Pattern Description
Blank Line Match no files - can serve as a separator for readability.
Lines starting with hash(#) Comment by default.
Trailing spaces being ignored unless they are quoted with backslash (\).
! Negates the pattern.
\ escape sensitive chars(E.g. # or ! or trailing spaces).
Ends with slash(/) match directory and any paths under it.
No slash(/) match pathname relative to .gitignore file or the top-level of the work tree if not from .gitignore.
* match anything except slash(/)
? match any one char except slash(/)
[] match any one char in a selected range.
A leading slash(/) match beginning of the pathname.
Two consecutive asterisks (**) match full pathname.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment