Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

I betcha didn’t know about git add in patch mode!

35,642 Aufrufe • vor 2 Jahren •via X (Twitter)

9 Kommentare

Profilbild von Mark Erikson
Mark Eriksonvor 2 Jahren

This is by far the biggest reason I've always preferred using a Git GUI for commits in most cases - the ability to visually pick and choose which hunks (or individual lines) get added, rather than using a TUI. Fork's great. Used to use SourceTree. VS Code's UI is awkward.

Profilbild von Liran Tal
Liran Talvor 2 Jahren

patch mode is great but how cool that you can do exactly that in VS Code's UI? :-)

Profilbild von Mx Corey Frang
Mx Corey Frangvor 2 Jahren

I almost always use -p. I actually have an alias that tracks new files without adding the lines so -p can catch them I use this step as a sort of self code review and reminder to remove console statements etc before it gets pushed

Profilbild von Andrej Maznevski
Andrej Maznevskivor 2 Jahren

git add -p is quite useful to interactively review and stage changes chunk by chunk. Note: This only stages modifications to existing files, not new files, meaning that they won't be added

Profilbild von Mike Behnke
Mike Behnkevor 2 Jahren

So glad to see this featured! I've been telling coworkers and anyone who will listen about using patch for years. Even have it aliased to `git ap`. Next do `git add -i` (or `--interactive`) for more command line fun, can do patch, but also revert, add files and more.

Profilbild von Andy Hails 👨‍💻
Andy Hails 👨‍💻vor 2 Jahren

"that was my band name in high school" actually made me do a spit take with my coffee! 😂

Profilbild von Kevin Moritz
Kevin Moritzvor 2 Jahren

I did know about it, and once I found out about it I have never gone back.

Profilbild von Sergii Shymko
Sergii Shymkovor 2 Jahren

IntelliJ IDEs allow you to pick and choose which changes to include in a commit. Uncheck the checkbox of unwanted changes from the diff viewer. Using this all the time along with moving some changes out to a separate Change Set.

Profilbild von Joe Attardi
Joe Attardivor 2 Jahren

Stage this hunk baby

Ähnliche Videos