DevOps Classroom notes 05/Mar/2026

Lets continue commits and create a mental model (visual git)

  • Lets create directory and make commits
mkdir commit_graphs
cd commit_graphs/
git init
touch Readme.md
git status
git add .
git commit -m "first"

  • Now lets make some more changes
echo "hello" > Readme.md
git status
git add .
git commit -m "second"

  • few more
echo "hello1" >> Readme.md
git status
git add .
git commit -m "third"

echo "hello2" >> Readme.md
git status
git add .
git commit -m "fourth"


echo "hello3" >> Readme.md
git status
git add .
git commit -m "fifth"

  • Git always points to latest commit.
  • What git is pointing is denoted by HEAD
  • In git this graph starts with a default name called as master.
  • Commit id is SHA1 Hash of
    • previous commit
    • current changes
    • author
    • datetime
    • message
  • Git only tracks files not folders
  • Using git add
git add <filename>
git add . # Add all changes in current and child directories
git add -A # Add all changes
git add -u # Add only modified changes
  • Lets learn what is untracked and modified
    • untracked: is a new file which was not part of git commits
    • modified: existing file which was part of git commits changed
    • deleted: existing file which was part of git commits deleted
    • renamed (it will appear in staging area)

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%