Skip to content

Commit

Permalink
update ignore.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCurrin committed May 19, 2024
1 parent 9deed7b commit c4aa2ab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions cheatsheets/version-control/git/ignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ description: Reference for the Git ignore file

### File at all levels

Ignores foo at all levels
Ignores `foo` at any location.

```
foo
```

### Fixed path

Ignores `foo` at `/fizz/foo` in the repo root.
Ignores `foo` only the root `fizz` directory.

```
fizz/foo
Expand All @@ -26,9 +26,19 @@ This does **not** ignore a path like `abc/fizz/foo`, so see below.

### Path at any level

ignores foo at fizz/foo, abc/fizz/foo, etc.
Ignores `foo` in any `fizz` directory at any level in the directory hierarchy.

e.g. `fizz/foo`, `abc/fizz/foo`.

```
*/fizz/foo
```

## Extension

Using the same rules as above but for a `.foo` file:

- **`*.foo`**: Ignores all files with the `.foo` extension, regardless of their directory.
- **`fizz/*.foo`**: Ignores files with the `.foo` extension only in the `fizz` directory at the root of the repository.
- **`*/fizz/*.foo`**: Ignores files with the `.foo` extension in any `fizz` directory, no matter where the `fizz` directory is located within the repository.

0 comments on commit c4aa2ab

Please sign in to comment.