Day 12/90: Git & GitHub Fundamentals for DevOps Engineers 🌿 #90DaysOfDevOps

Kanav Gathe - Oct 23 - - Dev Community

Day 12: Git & GitHub for DevOps Engineers 🚀

Hello DevOps enthusiasts! 👋 Welcome to Day 12 of the #90DaysOfDevOps challenge. Today, we're diving into Git and GitHub fundamentals.

Core Concepts 📝

What is Git?

Git is a distributed version control system that helps track changes in source code during software development. It enables:

  • Version tracking
  • Collaborative development
  • Code history maintenance
  • Branch management
  • Conflict resolution

Main Branch vs Master Branch

  • Both serve as the default branch
  • Main is the new standard (more inclusive)
  • Functionally identical
  • Can configure default when initializing repository

Git vs GitHub

Git:
- Version control system
- Runs locally
- Manages source code
- Command-line tool

GitHub:
- Web-based hosting service
- Cloud platform
- Provides collaboration features
- Has web interface
Enter fullscreen mode Exit fullscreen mode

Task Solutions 💻

1. Git Configuration

# Set username and email
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Enter fullscreen mode Exit fullscreen mode

2. Repository Setup

# Create and initialize repository
mkdir DevOps
cd DevOps
git init

# Create and add content
mkdir Git
echo "Initial content" > Git/Day-02.txt

# Stage and commit
git add .
git commit -m "Initial commit"

# Connect to GitHub
git remote add origin https://github.com/username/DevOps.git
git push -u origin main
Enter fullscreen mode Exit fullscreen mode

Local vs Remote Repository 🔄

Local Repository:

# Initialize local
git init
git add .
git commit -m "message"
Enter fullscreen mode Exit fullscreen mode

Remote Repository:

# Connect and push
git remote add origin <url>
git push -u origin main

# Verify remote
git remote -v
Enter fullscreen mode Exit fullscreen mode

Key Takeaways 💡

  • Git tracks code changes efficiently
  • Local and remote repos serve different purposes
  • Proper configuration is essential
  • Regular commits maintain clean history
  • Remote connection enables collaboration

Git #DevOps #GitHub #VersionControl #90DaysOfDevOps


This is Day 12 of my #90DaysOfDevOps journey. Keep versioning and collaborating!

. . . . . . . . . . . . . . .