![Forrest logo](/images/logo.png)
git-log:tldr:71cc4
git-log: Show the history of a particular file or directory, including differences.
$ git log -p ${filename_or_directory}
try on your machine
The "git log -p" command displays the commit history of a Git repository along with the changes made in each commit.
Here is a breakdown of the command:
- "git log" is the command used to display the commit history in Git.
- "-p" flag is used to include the actual changes made in each commit. It stands for "patch" and shows the differences between the current commit and its parent commit or the commit where the file was added.
- "${filename_or_directory}" is a placeholder that should be replaced with the actual filename or directory path you want to see the commit history and changes for.
By executing this command with the appropriate filename or directory, you will see a list of commits, along with the textual differences that were made in each commit for the specified file or directory.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.