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
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"
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
Local vs Remote Repository 🔄
Local Repository:
# Initialize local
git init
git add .
git commit -m "message"
Remote Repository:
# Connect and push
git remote add origin <url>
git push -u origin main
# Verify remote
git remote -v
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!