> For the complete documentation index, see [llms.txt](https://gittutorial.gitbook.io/practical-git-via-gitextensions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gittutorial.gitbook.io/practical-git-via-gitextensions/how-to-make-a-commit/adding-only-a-portion-of-a-file.md).

# 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
```
