DevOps Classroomnotes 18/Feb/2023

Hashing

  • Hashing algorithms are used to generated a random number.
  • If the message is same, Hash will be same
  • There is no way to generate message from hash
  • Alogrithms
    • MD5
    • SHA1
    • SHA256

Lets Dive into How git works

  • To understand git we will be using two plumbing commands
git cat-file -t 
# it tells the type of what you are looking at
git cat-file -p 
# it prints the values 
  • We have done 3 commits
    Preview
  • Lets find the type and contents of latest commit
    Preview
  • parent refers to previous commit
  • author/commiter is username and email configured
  • message
  • tree in git refers to folder/directory & blob refers to file
  • Lets see the contents of previous commit
    Preview
    Preview
  • Lets figure out the contents of first commit which is tree b8d76bc8378818320eee5e112d0b738feebc6c11
    Preview
  • Lets see the contents of file Readme.md e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
  • Now go to the second commit and print the contents
    Preview
  • two blobs have same id as the contents are same, same hash is generated by SHA1 algorithm
  • Lets see contents of src
    Preview
  • as hash is same even the contents of test also will be same.
  • main.py is an empty file,so the Hash matches with README.md as this is also empty
  • Lets see contents of latest commit
    Preview
  • Now the tree of latest commit
    Preview
    Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner