DEV Community

Discussion on: 🔱 Git Commands You Didn't Know

Collapse
 
catriel profile image
Catriel Lopez

Grep stands for "Global Regular Expression Printer". It gives you a clue about how it works, which is important, but "git search" doesn't.

I really like the plg and zip aliases, so I'm definitively stealing those! Thanks for writing!

Collapse
 
dephraiim profile image
Ephraim Atta-Duncan

Thanks for grep too. I guess search isn't

Collapse
 
bloodgain profile image
Cliff • Edited

That's more of a backronym, really. It actually comes from the relatively ancient ed line editor's command g/re/p which basically means "global search / for a regular expression / print matching lines". So it's at least a fairly accurate backronym to the source.

The g command still sort of lives on in vi/Vim's ex mode commands. The most common use these days is probably for g/pattern/d, which does a global search for the pattern and deletes matching lines, sort of the opposite of the original g/re/p command.

Collapse
 
catriel profile image
Catriel Lopez

Oh, I didn't know that! Thanks!