본문 바로가기

[IT/Programming]

Git/GitHub commit description 에서 특정 단어들 찾는 방법

반응형
m.logPrint() is working!

<eq> and <eqq> tags are rendered to MathJax format, being enclosed by \ ( \ ) and \ [ \ ].

docuK1 scripts started!
If this log is not closed automatically, there must be an error somewhere in your document or scripts.

Table of Contents is filled out.

Auto numberings of sections (div.sec>h2, div.subsec>h3, div.subsubsec>h4), <eqq> tags, and <figure> tags are done.

<cite> and <refer> tags are rendered to show bubble reference.

<codeprint> tags are printed to corresponding <pre> tags, only when the tags exist in the document.


Current styles (dark/bright mode, font-family, font-size, line-height) are shown.

disqus.js with id="disqus-js" is loaded.

kakao.js with id="kakao-js-sdk" is loaded.

New ShortKeys (T: Table of Contents, F: Forward Section, D: Previous Section, L: To 전체목록/[Lists]) are set.

m.delayPad=0;
m.wait=1024;
wait 1127ms.
▼ Hide
Toggle a mess
Go (FS)
TofC
DocuK Log
Backward
Forward
RRA
Lists
CmtZ
CmtX
Handle CmtZ
Log in
out focus
이 글이 도움이 되셨다면, 광고 클릭 한번씩만 부탁드립니다 =ㅂ=ㅋ. (If this article was helpful, please click the ad once. Thank you. ;)
Mode: Bright; Font: Noto Sans KR; font-size: 18.0px (10.0); line-height: 1.6;
width: 1280, height: 720, version: 3.1.1
Canonical URI: https://kipid.tistory.com/entry/Git-GitHub-commit-description-에서-특정-단어들-찾는-방법
dg:plink (Document Global Permanent Link): https://kipid.tistory.com/395
document.referrer: Empty
This document is rendered by docuK (See also SEE (Super Easy Edit) of docuK and pure SEE).

Git/GitHub commit description 에서 특정 단어들 찾는 방법

요약
OR 검색: git log --grep="단어1" --grep="단어2".

AND 검색: git log --all-match --grep="단어1" --grep="단어2".

정규 표현식: git log --grep="단어1|단어2" -E.
어떤 단어를 검색하고 싶은지, OR/AND 중 어떤 조건을 원하는지에 따라 골라 쓰면 됨.

TPH1.Posting History

▼ Show/Hide

T1.TOR

▼ Show/Hide
▲ Hide

T2.여러 --grep 옵션 사용

▼ Show/Hide
git log --grep="fix" --grep="update" --grep="add"
커밋 메시지에 "fix", "update", "add" 중 하나라도 포함된 커밋을 표시.
▲ Hide

T3.AND 조건으로 검색 (모두 포함)

▼ Show/Hide
git log --all-match --grep="fix" --grep="bug" --grep="test"
커밋 메시지에 "fix"와 "bug"와 "test"가 모두 포함된 커밋만 표시.
주의: 단어 순서나 위치는 상관없음.
대소문자 구분은 기본적으로 함. 무시하려면 --grep에 -i 추가
▲ Hide

T4.정규 표현식 사용 (-E 또는 -F)

▼ Show/Hide
하나의 --grep에 정규 표현식을 사용해 여러 단어를 검색할 수 있습니다. -E (확장 정규 표현식) 옵션을 사용하면 더 유연하게 패턴을 정의할 수 있습니다.
git log --grep="단어1|단어2|단어3" -E

git log --grep="단어1.*단어2" -E
// "단어1"과 "단어2"가 순서대로 포함된 경우.
▲ Hide

T5.대소문자 무시 검색

▼ Show/Hide
git log --grep="fix" --grep="Update" -i --all-match
"fix"와 "Update"를 대소문자 구분 없이 검색.
▲ Hide

T6.추가 팁

▼ Show/Hide
// 특정 브랜치 제한
git log 브랜치명 --grep="단어1" --grep="단어2"

// 날짜 범위
git log --since="2025-01-01" --until="2025-03-08" --grep="fix" --grep="update"

// 커밋 해시(%h)와 메시지(%s)만 표시.
git log --grep="fix" --grep="update" --pretty=format:"%h - %s"
▲ Hide
이 글이 도움이 되셨다면, 광고 클릭 한번씩만 부탁드립니다 =ㅂ=ㅋ. (If this article was helpful, please click the ad once. Thank you. ;)
반응형
Get page views