# Create a gitignore

> I'm jotting it down so as not to forget how to create a .gitignore later on

\ <br>

### 1. `cd` into your projects root directory

<br>

### 2. Create `.gitignore` file

```bash
touch .gitignore
```

<br>

### 3. Write it down using `.gitignore` patterns

ex)

* To exclude all files ending in `.log`

  ```
  *.log
  ```
* To exclude any file names that contain `.log`

  ```
  *.log*
  ```
* To exclude all files in a specific path

  ```
  /Build/*
  ```

\ <br>

`+`

### If you create a `.gitignore` when in use

```bash
git rm -r --cached .

git add .

git commit -m "git ignore add"

git push
```

\ <br>

#### `.gitignore` example

```
*.bash_history

*.gitconfig

*.python_history

.c9/

.cache/

.local/
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chloe-codes1.gitbook.io/til/git/create_a_gitignore.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
