Difference between different git search commands

前端 未结 2 1843
无人及你
无人及你 2020-11-30 14:09

A question from a beginner: there are several ways to search in git history. To me, it is not clear what, the difference between the commands really is:

2条回答
  •  星月不相逢
    2020-11-30 15:09

    git log searches in the commit messages?

    Yes. Options -S/-G search for commits that change the number of occurence (i.e., add or remove) mentioned text. --grep searches through entire commit messages.

    git grep seems to search everywhere: in files, blobs, trees and commit objects?

    No, only in files (that is, blobs).

提交回复
热议问题