Git and GitHub – Git Log Explanation (Part-14)

Posted by

Git Log Explanation

git log --oneline
94ebf5f (HEAD -> ramukaka) ramukka
421b92c (tag: rel1.0, master) cherry2
8aa52e5 file10
2ba2c83 file9
cc0471f Revert "bad"
2c8439c bad
cd9fc7b good
61c4cfc (origin/master, origin/HEAD) adding other user
7062f9b all
3d0f845 file1
ba9fae7 Adding first commit

Explanation of Each Part

1. Commit Hash

  • Each commit starts with a unique identifier called a commit hash (e.g., 94ebf5f). This is a shortened version of the full hash that uniquely identifies the commit.

2. References (Branches and Tags)

  • Following the commit hash, you might see references like branches and tags:
    • HEAD -> ramukaka: Indicates that the HEAD is pointing to the ramukaka branch. The HEAD represents the current commit your working directory is pointing to.
    • (tag: rel1.0, master): Indicates that this commit is tagged with rel1.0 and is also the tip of the master branch.
    • (origin/master, origin/HEAD): Indicates that the commit is the latest commit in the remote master branch and is also the default branch (HEAD) of the remote repository.

3. Commit Message

  • After the commit hash and references, you see the commit message (e.g., ramukka, cherry2, file10). This message was provided by the user when the commit was created and typically describes the changes made in that commit.

Simplified Breakdown of Each Line

  1. 94ebf5f (HEAD -> ramukaka) ramukka
    • Commit hash: 94ebf5f
    • Current branch: ramukaka
    • Commit message: ramukka
  2. 421b92c (tag: rel1.0, master) cherry2
    • Commit hash: 421b92c
    • Tag: rel1.0
    • Branch: master
    • Commit message: cherry2
  3. 8aa52e5 file10
    • Commit hash: 8aa52e5
    • Commit message: file10
  4. 2ba2c83 file9
    • Commit hash: 2ba2c83
    • Commit message: file9
  5. cc0471f Revert "bad"
    • Commit hash: cc0471f
    • Commit message: Revert "bad"
    • This indicates a commit that reverts a previous commit with the message "bad".
  6. 2c8439c bad
    • Commit hash: 2c8439c
    • Commit message: bad
  7. cd9fc7b good
    • Commit hash: cd9fc7b
    • Commit message: good
  8. 61c4cfc (origin/master, origin/HEAD) adding other user
    • Commit hash: 61c4cfc
    • Remote branch: origin/master
    • Remote HEAD: origin/HEAD
    • Commit message: adding other user
  9. 7062f9b all
    • Commit hash: 7062f9b
    • Commit message: all
  10. 3d0f845 file1
    • Commit hash: 3d0f845
    • Commit message: file1
  11. ba9fae7 Adding first commit
    • Commit hash: ba9fae7
    • Commit message: Adding first commit

Summary

The git log --oneline command provides a concise view of the commit history. Each line includes:

  • A shortened commit hash
  • Any relevant references (branches or tags)
  • The commit message
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x