Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Viewing Changes | More Advanced Interaction
Git Essentials

bookViewing Changes

メニューを表示するにはスワイプしてください

git log -p

The git log command displays the commit history of a project. To view the exact lines changed in each commit, use the -p (patch) flag. This approach is helpful when you need to quickly identify a commit that introduced a bug in the code.

Full command:

Run the command in the terminal:

Git log -p

Each commit is separated by a frame of different colors to improve visual distinction. Because the detailed information about each commit may not fit on one screen, use the arrow keys to scroll up and down.

Note
Note

You can exit pressing the q key.

Here, plus signs indicate added lines, and if any lines were deleted, they would appear with minus (dash) symbols.

git show

The git show command displays detailed information about the changes introduced by a specific commit. Basic syntax:

git show [commit]

Here, [commit] refers to the hash (identifier) of the commit you want to view.

Examine the output of the git log -p command, focusing on the second latest commit:

Here are the first few lines of the output for this commit. To use the git show command for this commit, copy its hash and run the following command:

Note
Note

Your commit hash may be different, so be sure to use the correct hash.

Run this command in the terminal:

Git show

As you can see, the output is the same as for the git log -p command, but only for one commit.

question mark

What is the main difference between the git log -p and git show commands?

正しい答えを選んでください

すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 2.  2

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

セクション 2.  2
some-alt