DEV Community

Cover image for TIL: the Git -p flag!
Austin Vance for Focused

Posted on • Edited on • Originally published at focusedlabs.io

10 6

TIL: the Git -p flag!

Today I learned about the -p flag in git and now I want to use it everywhere!

According to the man page:

$ man git-add

...
-p, --patch
Use the interactive patch selection interface to chose which changes to commit. See git-add(1) for details
...
Enter fullscreen mode Exit fullscreen mode

You can use the -p flag with checkout, add, commit

Git Patch!!!!!

How cool

Top comments (3)

Collapse
 
anduser96 profile image
Andrei Gatej

There is also git add -i, very useful most of the times!

Collapse
 
austinbv profile image
Austin Vance

Want to try a #bloggolf blog post on it?? We will give all the 🦄

Collapse
 
anduser96 profile image
Andrei Gatej

I don't think I can provide much value through an article, considering all the other resources that are out there. Also, what is a #bloggolf blog post ?

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay