# Adding only a portion of a file

See <https://git-extensions-documentation.readthedocs.io/en/latest/commit.html#staging-selected-lines>

In the commit dialog, we do not have to commit all of the changes of a file. In the diff view on the right, we can select individual lines for the next commit, and press the \[S] key or the Stage context menu item to add the lines to the staging area.

You may want to turn the `ignore white space` options off which can be located at the dock bar on the right top of the diff view when the view is focused.

Command line:

```
git add -i
# or
git add --interactive
```


---

# 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://gittutorial.gitbook.io/practical-git-via-gitextensions/how-to-make-a-commit/adding-only-a-portion-of-a-file.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.
