Skip to main content

Command Palette

Search for a command to run...

πŸš€ DevSecOps Journey β€” Day 12

Published
β€’3 min read
πŸš€ DevSecOps Journey β€” Day 12

From Linux & Shell Scripting to Git and Corporate Branching Strategies

✨ Understanding why Git exists and how teams collaborate at scale

Today marked an important transition in my DevSecOps journey. After completing Linux and Shell Scripting fundamentals, I moved into Git and corporate branching strategies.

Although I was already familiar with Git commands as a software engineer, revisiting Git with a DevOps mindset helped me understand why version control was created and how it solves real collaboration problems.


❓ Why Git Was Needed

Before Git and modern version control systems, teams faced multiple challenges:

  • ❌ No version history

  • ❌ Multiple developers editing the same file

  • ❌ No central coordination

  • ❌ No accountability for changes

  • ❌ Single point of failure

  • ❌ No isolation for features or fixes

These problems made collaboration slow, risky, and error-prone.


βœ… How Git Solves These Problems

Git addresses these challenges by providing:

  • 🌍 Open-source version control

  • 🧾 Complete change tracking

  • πŸ‘₯ Distributed collaboration (multiple contributors)

  • πŸ”„ Rollback to previous versions

  • πŸ—‚ Reliable code management

Git makes collaboration safe, auditable, and scalable.


πŸ“¦ What is a Git Repository?

A Git repository is the place where:

  • Source code lives

  • Version history is stored

  • Changes are tracked over time

  • πŸ™ GitHub

  • 🦊 GitLab

  • 🧰 Bitbucket

These platforms also support pull requests, CI/CD, access control, and team collaboration.


🌿 Understanding Git Branches

Branches allow developers to create independent copies of the source code.

Why branches are important:

  • πŸš€ Feature development

  • 🐞 Bug fixes

  • πŸ§ͺ Experiments

  • πŸ‘₯ Parallel development

Work on a branch does not affect the main code until merged.


πŸ”„ Git Workflow (High-Level View)

Working Directory β†’ Staging β†’ Commit β†’ Push
touch test.java β†’ git add . β†’ git commit -m "message" β†’ git push

What happens internally:

  • 🧬 Git creates blobs using SHA-1 hashes (40 characters)

  • πŸ“Έ Each commit represents a snapshot of the project state


🏷 Tracked vs Staged Files (Refresher)

Understanding file states is crucial:

  • Untracked β†’ Git is not aware of the file

  • Tracked β†’ Git knows about the file

  • Staged β†’ Ready to be committed

Example:

touch 2.txt        # untracked & unstaged
git add .          # tracked & staged
# modify file again
# tracked & unstaged

πŸ” Comparing Changes with git diff

Learned how to compare changes using:

git diff branch1 branch2

You can also compare using commit hashes instead of branch names.

This is useful for:

  • Code reviews

  • Debugging changes

  • Release analysis


πŸ”€ Merge vs Rebase

Understanding the difference is critical in corporate workflows:

πŸ”Ή Merge

  • Combines branches

  • Creates a merge commit

  • Preserves full history

πŸ”Ή Rebase

  • Rewrites commit history

  • No merge commit

  • Produces a cleaner, linear history

Choosing between merge and rebase depends on team standards and repository policies.


🎯 Why This Matters in DevOps & DevSecOps

Git is more than a version control tool. It enables:

  • πŸ”„ CI/CD pipelines

  • πŸ›‘ Secure code changes

  • πŸ‘₯ Team collaboration

  • πŸ“Š Auditability

  • πŸš€ Reliable releases

Understanding Git deeply is essential for building scalable DevOps workflows.


βœ… Day 12 Summary

Today, I learned and refreshed:

  • Why Git was created

  • How Git solves collaboration problems

  • Git repositories and platforms

  • Branching fundamentals

  • Git workflow and internal concepts

  • Tracked vs staged files

  • git diff, merge, and rebase

This knowledge forms the backbone of modern software delivery and DevSecOps pipelines.

More from this blog

D

DevSecOps - Zero To Hero

19 posts