← Useful Tips
git add -p: Stage only selected hunks from a changed file
Use git add -p to stage only selected hunks from a changed file. It makes version-control work faster and reduces avoidable mistakes.
git add -p
Why it helps
Use git add -p to stage only selected hunks from a changed file. It makes version-control work faster and reduces avoidable mistakes.
How to use it
- Open the relevant app or terminal.
- Use the shortcut or command above in the relevant context.
- Check the result; for commands that change data, test on a small example first.
People also search for
git add -p: Stage only selected hunks from a changed filegit add -pstage only selected hunks from a changed filehow to stage only selected hunks from a changed fileGit stage only selected hunks from a changed file