I searched for a topic of interest in a commit log:
$ git log --pretty=oneline | grep -i ... $SHA1 < ... commit message ... >
I now have a SHA1
, and I want to know information about the files affecting that SHA1
and maybe later diff
them with their parent. How can I get this done?
`git log` command is used to view the commit history and display the necessary information of the git repository. This command displays the latest git commits information in chronological order, and the last commit will be displayed first.
If you have the hash for a commit, you can use the git show command to display the changes for that single commit. The output is identical to each individual commit when using git log -p .
The SHA1 of the commit is the hash of all the information. And because this hash is unique to its content, a commit can't change. If you change any data about the commit, it will have a new SHA1. Even if the files don't change, the created date will. A commit is a code snapshot.
The commit object contains the directory tree object hash, parent commit hash, author, committer, date and message.
git show <SHA1>
will show the commit date, author, parent, and diff of files that changed from parent commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With