Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

How to search a Git repository by commit message?

Asked by Amit Raj Jul 5, 2021 1.5K views 2 answers
Share

About this question

 I checked some source code into GIT with the commit message "Build 0051".

However, I can't seem to find that source code anymore - how do I extract this source from the GIT repository, using the command line?

The source code is definitely there, now its a matter of checking it out:

C:Source>git log -g --grep="0052"
commit 77b1f718d19e5cf46e2fab8405a9a0859c9c2889
Reflog: HEAD@{10} (unknown )
Reflog message: commit: 20110819 - 1724 - GL: Intermediate version. File version:  v0.5.0 build 0052.
Author: unknown
Date:  TueJul16 17:24:51 2019 +0100
    20110819 - 1724 - GL: Intermediate version. File version: v0.5.0 build 0052.
C:Source>

Your answer

2 Answers

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.