DEV Community

Kanav Gathe
Kanav Gathe

Posted on β€’ Edited on

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

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!

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more