search

Home  >  Q&A  >  body text

How to view only the changes of a certain file in a commit in Git

There are three commits in total, such as,

history_commit_a
history_commit_b
history_commit_c

Among them, 50 files in history_commit_b have been modified, and the file names are

        history_commit_b_file1
        history_commit_b_file2
        history_commit_b_file3
        .
        .
        .

Wait.

Then the question comes. If I want to see what changes have occurred in history_commit_b_file50 in history_commit_b, use directly:

git show history_commit_b;

Git will list the changes in all files at once. Can you use the command to control git to only display the changes in the history_commit_b_file50 files in history_commit_b, but not the changes in the history_commit_b_file1...history_commit_b_file49 files?

大家讲道理大家讲道理2791 days ago568

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-02 09:48:46

    gitk history_commit_b_file50
    git show history_commit_b history_commit_b_file50

    reply
    0
  • Cancelreply