Command

Git add -p

Interactively chooses hunks to stage. y accepts, n skips, q stops, and ? gives help. Review the actual patch and the index before committing.

Formal Syntax & Structure

git syntaxgit
git add -p [--] [<pathspec>...]

Working Example

Example Snippetgit
git add -p -- guide.txt
Git Reference