No video

022 Introduction to git grep

  Рет қаралды 4,561

Dan Gitschooldude

Dan Gitschooldude

Күн бұрын

Пікірлер: 19
@onurpekdemir
@onurpekdemir 6 жыл бұрын
Another great Video! Thanks so much Dan! BTW: I'd really love to see some videos about RegEx as you have a great and straight forward way of explaining things.
@ganainm01
@ganainm01 4 жыл бұрын
Some grep history. grep comes from the ancient Unix line editor ed's "global" command, which applies another command to each line matching a regular expression ("re"). The "p" means "p"rint matching lines. This command could appear in manual pages as "g/re/p" - globally (i.e., cover all lines) search for the regular expression between the slashes and print matching lines. And because the namesake program does basically the same with files in the filesystem as the "g/re/p" command does with lines in a file, the program was simply called "grep."
@nefed-L
@nefed-L 11 ай бұрын
Как раз то, что я искала! Думаю, что за grep такой)) Thanks!
@BrendenVogt
@BrendenVogt 4 жыл бұрын
Great video!! Would love to see more tutorials in the future
@nbensa
@nbensa 2 жыл бұрын
grep is g/re/p, an ed command to do g)lobal re)gular expression search and p)print 🙂 btw, ed is the precursor to v,i which in turn is the precursor to vim and, nowdays, nvim.
@yash1152
@yash1152 Жыл бұрын
and nowdays, helix
@aram5642
@aram5642 3 жыл бұрын
Never had a case for that grep, but recently in the git-log manual I came across what they call "pickaxe" which is searching among patches for an occurrence of a string, which is how you could search when a piece of code (like a function call) was added or even removed.
@yash1152
@yash1152 Жыл бұрын
> _"pickaxe" which is searching among patches for an occurrence of a string"_ > _"when a piece of code (like a function call) was added or even removed"_ i was also thinking about the ability to search within diffs/patches only
@jimkd3147
@jimkd3147 7 жыл бұрын
I noticed that your commit messages are in simple past. Mine were, too, until I recently switched to imperative because everyone else seems to do this and all the style guides tell you to do it. Can you make a video about commit message style?
@DanGitschooldude
@DanGitschooldude 7 жыл бұрын
Interesting, I wasn't aware there was such guidance on tense of the commit messages. Good suggestion for a new video, I'll have to get smarter about the style conventions first. Thanks for watching!
@jimkd3147
@jimkd3147 7 жыл бұрын
You have to comply with the guidelines for commit messages the git developers like when contributing to git. Those seem to be pretty much the same rules you find when googling for commit message guidelines. I don't agree with all of them. That's why I think hearing the opinion of someone else who knows a lot about git would be interesting. Whether you write in simple past or imperative is a matter of taste, imho. But there are stupid rules like using at most 50 characters in the first line but leaving out the period in the end to save one character because staying below 50 characters can be difficult. I think leaving out the period in the end of a sentence is just pointless (no pun intended) when only trying to comply to an arbitrary limit which can just be increased by 1 to make up for the 1 character "wasted" for proper punctuation. Another imho stupid one it to do hard line breaking. I think doing proper visual line wrapping in the few cases the commit messages are printed isn't really difficult and it has two advantages: 1. You can view them in a terminal of arbitrary width. If the terminal you use is wider than the line wrapping length of hard line breaking, space is wasted. If it's smaller, it looks really, really awful. 2. If you edit a commit message after first writing it, undoing hard line breaking is wasted time. No need to do this with visual line wrapping. The git developers could just implement visual line wrapping, remove that rule, and be rid of the disadvantages of hard line breaking outlined above. I don't really see any disadvantages.
@yash1152
@yash1152 Жыл бұрын
9:12 how to make it show the line numbers too? so, like file.ext:12:chicken
@mbramante
@mbramante Жыл бұрын
can this be used in command window ?
@dhruvnaik3556
@dhruvnaik3556 5 жыл бұрын
Global Search of Regular Expression(grep).
@rsmolkin
@rsmolkin 6 жыл бұрын
Can you do git grep over multiple repos?
@DanGitschooldude
@DanGitschooldude 6 жыл бұрын
Not sure what you mean. If you are asking if you can git grep over submodules, you can embed the command in a 'git submodule foreach 'git grep... ' ' to grep across any submodules as in the project. But no you can't git grep "outside" a particular repo because there's no history outside a repo!
@rsmolkin
@rsmolkin 6 жыл бұрын
Dan Gitschooldude yeah I meant my company has over 100 repos and sometimes we need to search code across all of them
@DanGitschooldude
@DanGitschooldude 6 жыл бұрын
Ah, I see. You'll probably want to write a script that traverses all your repos and executes the 'git grep' command in all of them. If your repos are all in a tool like Gitlab, you might be able to search across multiple projects, but I'm not sure if that's a feature in Gitlab or not. Thanks for watching!
@avijitsharma5050
@avijitsharma5050 5 жыл бұрын
Dan Gitschooldude I was also looking for the same thing as described by Roman in above comment.
023 Introduction to Git Hooks
17:03
Dan Gitschooldude
Рет қаралды 15 М.
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 39 МЛН
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 19 МЛН
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 1,3 МЛН
Happy birthday to you by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 11 МЛН
032 Introduction to Git Subtrees
20:43
Dan Gitschooldude
Рет қаралды 39 М.
010 Introduction to the Git Index
17:53
Dan Gitschooldude
Рет қаралды 5 М.
Creator of git, Linus Torvalds Presents the Fundamentals of git
1:10:15
Developers Alliance
Рет қаралды 81 М.
Git Branches Tutorial
33:20
freeCodeCamp.org
Рет қаралды 243 М.
how to search a repo using `git grep` (beginner) anthony explains #231
5:48
Beginner's Guide to the Bash Terminal
1:14:37
Joe Collins
Рет қаралды 2,3 МЛН
009 More about git submodules
19:47
Dan Gitschooldude
Рет қаралды 13 М.
Makefiles: 95% of what you need to know
1:01:53
Gabriel Parmer
Рет қаралды 120 М.
Top 10 Linux Job Interview Questions
16:04
tutoriaLinux
Рет қаралды 2,3 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 39 МЛН