Git (Part 1)
Today is Day 22 of my DevOps/AWS learning journey, and I started exploring Git, one of the most important tools for developers and DevOps engineers. Git is a distributed version control system that allows tracking file changes, maintaining project history, and enabling team collaboration.
For me, this marks the foundation of proper version control practices, which will be critical in both solo projects and team-based DevOps workflows.
What I Learned
Installation
Amazon Linux →
sudo yum install git -yUbuntu →
sudo apt install git -yWindows → Installed from git-scm.com
Verified using →
git --version
Configuration (one-time setup)
git config --global user.name "YourName"
git config --global user.email "youremail@example.com"
git config --list
This ensures every commit is tagged with the right author details.
Git Areas (Conceptual Stages)
Working Directory – Where files are created/modified.
Staging Area – Snapshot of changes marked for commit.
Local Repository – Commits stored locally.
Remote Repository (e.g., GitHub) – Central place for collaboration.
Workflow I Practiced
Working Directory → git add → Staging Area → git commit → Local Repo → git push → Remote Repo
Commands Explored
git init→ Initialize a repository.git status→ See file status.git add ./git add <file>→ Stage changes.git commit -m "message"→ Commit to local repo.git log,git log --oneline,git show→ Explore commit history.git diff→ Compare changes.git blame <file>→ See line-by-line history.git commit --amend→ Update the last commit message.
What I Built / Practiced
Installed Git on a VM and configured user details.
Initialized a test repository, created files, and tracked changes.
Practiced staging and committing using
git addandgit commit.Explored different ways to view commit history and diffs.
Updated a commit message using
git commit --amend.
This hands-on approach gave me clarity on how Git records and manages changes at every stage.
Key Takeaway
Today I realized Git is more than just a tool—it’s a safety net for developers. By breaking down changes into stages (working → staging → commit), Git ensures control, traceability, and collaboration. Even a single file change has a complete history, making debugging and teamwork more reliable.
Next Steps
Learn Git branching and merging.
Practice handling merge conflicts.
Explore rebase and interactive history rewriting.
Push local repositories to GitHub and work with remotes.