Day 3 — Git and GitHub for DevOps As part of my daily DevOps posts, today I’m sharing one of the most important foundations in modern software delivery: Git and GitHub. Git is the version control system that helps track changes in code, collaborate safely, and manage different versions of a project. GitHub makes it easier to work with teams, review code, and support CI/CD workflows. Some essential Git commands and concepts: • git init — initialize a repository • git clone — copy an existing repo • git status — check current changes • git add — stage files for commit • git commit — save changes • git push — send changes to GitHub • git pull — get latest changes • git fetch — download changes without merging • git branch — create or view branches • git checkout — switch branches • git switch — modern way to switch branches • git merge — combine branches • git rebase — reapply commits on top of another branch (clean history) • git stash — temporarily save changes • git log — view commit history • git diff — see changes between commits/files • git reset — undo changes (careful usage) Key concepts: • Branching strategy • Pull requests (PRs) for code review • Conflict resolution • Clean commit history Git and GitHub are used in almost every DevOps workflow, especially for collaboration, automation, and CI/CD pipelines. I’ll continue posting one DevOps tool or concept every day. #Git #GitHub #DevOps #VersionControl #CICD #Automation #SoftwareEngineering #CloudComputing #DevOpsEngineer #Coding #TeamCollaboration #TechCommunity #LearningEveryDay #DeveloperTools #job #hr #hiring
Mastering Git and GitHub for DevOps Essentials
More Relevant Posts
-
Day 27 Of DevOps 🚀 What is GitHub? GitHub is a cloud-based platform built on Git that allows developers to store, manage, track, and collaborate on source code. It is one of the most widely used platforms in DevOps and modern software development. 🔍 Why GitHub is Important in DevOps? ✔ Centralized code repository (Git-based) ✔ Collaboration through Pull Requests ✔ Code reviews & branch protection ✔ CI/CD with GitHub Actions ✔ Issue tracking & project boards ✔ Open-source collaboration 🛠 Key Features 🌿 Repositories Store code, configuration files, Infrastructure as Code (Terraform), Kubernetes YAML, etc. 🔀 Branching & Pull Requests Create feature branches → Submit PR → Review → Merge. ⚙ GitHub Actions (CI/CD) Automate build, test, and deployment pipelines. 🐞 Issues & Projects Track bugs, features, and enhancements. 🔐 Security Features Code scanning, secret scanning, dependency alerts. 🔥 Real DevOps Workflow Example • Developer pushes code to GitHub • Pull Request created • CI pipeline triggered automatically • Tests executed • Code reviewed • Merged to main branch • Auto-deployment triggered (Example: GitLab, Bitbucket) 🎯 Why Every DevOps Engineer Must Know GitHub Because it connects: Version Control → CI/CD → Security → Deployment → Collaboration It is the backbone of modern cloud-native development. #GitHub #Git #DevOps #CICD #Automation #SoftwareDevelopment #CloudComputing #InfrastructureAsCode #Kubernetes #TechCareers
To view or add a comment, sign in
-
🚀 #100DaysOfDevOps – Day 7 Today I explored advanced Git operations for commit history management and recovery, focusing on real-time development and troubleshooting scenarios. 🔹 Git Log (History Analysis) Used to track changes and understand commit history. ✔ Scenario: Debugging issues by identifying recent changes ✔ Scenario: Tracking who made specific changes in the codebase Commands: git log --oneline git log -3 git log --graph --oneline --all 🔹 Git Amend (Modify Last Commit) Used to update the most recent commit. ✔ Scenario: Fixing incorrect commit messages ✔ Scenario: Adding missed changes to the latest commit Commands: git commit --amend -m "message" git commit --amend --no-edit 🔹 Git Reset (Undo Changes) Used to move back to previous commits. ✔ Scenario: Removing unwanted commits before pushing to remote ✔ Scenario: Fixing mistakes in local commits Commands: git reset --soft HEAD~1 git reset --hard HEAD~1 🔹 Git Revert (Safe Undo) Used to undo changes without deleting history. ✔ Scenario: Reverting production issues safely ✔ Scenario: Maintaining audit/history while fixing bugs Command: git revert <commit-id> 🔹 Git Ignore (.gitignore) Used to exclude unnecessary files from tracking. ✔ Scenario: Ignoring log files, build artifacts, secrets ✔ Scenario: Preventing unwanted files from being pushed to repo 💡 Understanding these commands is crucial for code recovery, debugging, and maintaining clean commit history in real DevOps workflows. Not just writing code — managing its history effectively. 💪 #Git #DevOps #VersionControl #CloudEngineering #100DaysChallenge #ContinuousLearning
To view or add a comment, sign in
-
-
🔧 Git Mastery: From Basics to DevOps Workflows Git isn’t just a tool it’s the backbone of modern development, collaboration, and deployment 🚀 🔐 Technical Breakdown: • 📂 Core commands: git init, clone, add, commit, push, pull • 🌿 Branching: branch, checkout, merge, rebase for parallel development • 🔄 Tracking changes: git log, diff, status for visibility • ☁️ Remote ops: git remote, fetch, push origin • 🧹 Undo changes: reset, revert, restore • 📦 Stashing: save work temporarily with git stash • 🏷️ Tags: versioning releases for production • ⚙️ Hooks: automate workflows (pre-commit, post-merge) • 🚀 CI/CD: Git triggers automated builds & deployments • 🐳 DevOps use: Docker, IaC & GitOps workflows 💡 One key takeaway: Git is not just version control it’s the engine behind DevOps automation. 👉 Master Git step-by-step and practice real workflows daily. 💬 Comment “GIT PRO” if you want advanced labs + real DevOps scenarios! #Git #DevOps #VersionControl #CI_CD #Automation #Docker #Kubernetes #TechSkills #Developers #Learning
To view or add a comment, sign in
-
Git isn't just a version control tool — it's the starting point of your entire delivery pipeline. Every CI/CD pipeline, every deployment, every infrastructure change begins with a Git event. A push, a merge, a pull request. Here are the Git commands that actually matter in DevOps: The daily basics: → git clone — copy a repo to your local machine → git pull — get the latest changes from remote → git add . — stage all changes → git commit -m " " — save your changes with a message → git push — send your changes to remote Branching: → git branch — list all local branches → git checkout -b name — create and switch to a new branch → git merge branch-name — merge changes from one branch into another Debugging and recovery: → git log --oneline — see commit history in a clean format → git diff — see exactly what changed between states. → git revert <commit> — undo a commit safely without rewriting history → git stash — temporarily save changes you're not ready to commit Status: → git status — Run git status constantly. It tells you exactly where you are, what's staged, what's not, and what branch you're on. It saves so much confusion. Understanding Git properly means understanding how the entire delivery process begins. What Git command do you wish you had learned earlier? 👇 #DevOps #Git #VersionControl #CICD #LearningDevOps #BeginnerDevOps #TechCareers #LearningInPublic
To view or add a comment, sign in
-
-
30 Days DevOps Revision Challenge – Day 2 Day 2 of my DevOps revision challenge — and today was all about going deeper into Jenkins and organizing everything I’ve learned so far. Yesterday was more about getting started and building a real pipeline. But today, I focused on strengthening almost all important Jenkins concepts in a more structured and practical way. 📌 Day 2 Focus: Advanced Jenkins Concepts Today I worked on multiple key areas to understand how Jenkins is actually used in real-world environments: 🔐 User-Based Authentication Explored how to manage users and roles Understood access control and security basics in Jenkins 📦 Shared Library (Deep Dive) Practiced creating and structuring shared libraries Improved reusability and organization of pipeline code 🔑 Credentials Management Learned how to securely store and use credentials Integrated credentials into pipelines safely 🔄 Build via SCM (GitHub Integration) Created jobs directly connected to GitHub repositories Automated build process using source code changes ⚡ Trigger Builds Without Opening Jenkins UI Configured builds to trigger directly from GitHub Used webhooks effectively for automation 🧑💻 Agent Setup Created and configured Jenkins agents Understood distributed builds and scalability 🔗 Webhook Optimization Used webhooks more efficiently Ensured proper trigger flow and debugging 💡 Key Takeaway Today felt like I connected all the scattered pieces of Jenkins into a complete system. From authentication → credentials → pipelines → agents → automation Everything now feels more organized and production-oriented. 🎯 Progress So Far Day 1: Pipeline + Django App + Shared Library basics Day 2: Advanced Jenkins concepts + full ecosystem understanding Slowly moving from just knowing tools → to actually understanding how everything fits together in production. I’ll continue sharing my journey daily. Consistency is the main goal 💯 If you’re also learning DevOps, let’s connect and grow together #DevOps #30DaysChallenge #Jenkins #CICD #Automation #Webhooks #LearningInPublic #Consistency #TechJourney
To view or add a comment, sign in
-
🚀 Master Git Like a Pro — Save This Cheat Sheet! If you're in DevOps, SRE, or Software Engineering… 👉 Git is your daily weapon. But remembering commands = 😵💫 So here’s a quick breakdown you’ll actually use: 🔹 Basic Commands • git init → Start a new repository • git clone <url> → Copy repo locally • git status → Check changes • git add . → Stage all changes • git commit -m "msg" → Save changes 🌿 Branching • git branch → List branches • git checkout -b feature → Create + switch branch • git merge feature → Merge into main • git branch -d feature → Delete branch 🌍 Remote • git pull → Fetch + merge latest changes • git push → Upload your commits • git remote -v → Show remote repos ⏪ Undo Changes • git checkout -- file → Discard changes • git reset HEAD file → Unstage file • git revert <commit> → Undo commit safely • git reset --hard → Reset everything (⚠️ careful!) 📜 Logs & Debugging • git log → Full history • git log --oneline → Compact view • git diff → See changes • git blame file → Who changed what 📦 Stashing • git stash → Save work temporarily • git stash pop → Restore work • git stash list → View stashes 💡 Pro Tips ✔️ Commit small, commit often ✔️ Use meaningful commit messages ✔️ Always pull before push ✔️ Use branches — never work directly on main 🔥 If this helps you: ✔️ Save it (you’ll need it later) ✔️ Follow for more DevOps/SRE content #Git #DevOps #SRE #SoftwareEngineering #Coding #GitCommands #VersionControl #LearnGit #ProgrammingTips #DevOpsEngineer #Cloud #Kubernetes #Terraform #CareerGrowth #TechCommunity #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 GitHub for DevOps – Day 4 (Part 1) 🔥 Git Reset — The Most Misunderstood Command in Git As a DevOps Engineer, you’re not just writing code — you’re managing history, fixing mistakes, and maintaining clean repositories. 👉 That’s where git reset becomes powerful. 📌 Simple Meaning: Git reset = Move your project back to a previous commit Example: A → B → C → D Want to go back to B? 👉 git reset B ⚙️ Git Works in 3 Areas (Must Know) 1️⃣ Working Directory → Your files 2️⃣ Staging Area → git add 3️⃣ Repository → commits 🔥 Types of Git Reset 🔹 1. Soft Reset (Safe) 👉 git reset --soft HEAD~1 ✔ Commit removed ✔ Changes still in staging 💡 Use when: You want to fix commit message or recombine commits 🔹 2. Mixed Reset (Default) 👉 git reset HEAD~1 ✔ Commit removed ✔ Staging cleared ✔ Changes still in files 💡 Use when: You added wrong files 🔹 3. Hard Reset (Dangerous ⚠️) 👉 git reset --hard HEAD~1 ❌ Commit removed ❌ Staging removed ❌ Changes deleted permanently 💡 Use when: You want to completely discard changes 📍 When to Use? ✔ Fix wrong commit → soft reset ✔ Remove staged files → mixed reset ✔ Delete everything → hard reset 🚨 Golden Rule 👉 Use git reset only in local branches 👉 Avoid using it on shared/main branches 💬 Real DevOps work is not about tools It’s about controlling changes safely and confidently. #HiteshDevOps #DevOps #Git #GitHub #CI_CD #Docker #Kubernetes #AWS #OpenToWork #HiringDevOps #DevOpsEngineer #TechHiring #LearningInPublic #BuildInPublic #TechJourney
To view or add a comment, sign in
-
-
Git in Real Life: When I started using Git, I thought it’s just for pushing code. But in real production environments, Git becomes the single source of truth. Let me share a real-world scenario Scenario: Production Issue One day, a critical service started failing after deployment. Everything looked fine in CI/CD, but users were facing errors. First step? Not logs… Git history. Using: git log --oneline We traced a recent commit where a config file was modified. Use Case: Root Cause Analysis We compared changes using: git diff <commit-id> Found that: - Environment variable was changed - API endpoint misconfigured A small change, but huge impact. Fix Strategy Instead of manually fixing, we rolled back safely: git revert <commit-id> git push origin main Production stabilized within minutes Daily Use Cases of Git in DevOps - Managing infrastructure code (Terraform, Kubernetes YAMLs) - Version controlling CI/CD pipelines - Tracking configuration changes - Enabling team collaboration - Supporting GitOps workflows Must-Know Commands (Real Usage) git clone <repo> git checkout -b feature-branch git add . git commit -m "feature update" git push origin feature-branch git pull origin main git merge main Troubleshooting Scenarios 1. Merge Conflict git pull origin main Fix conflicts manually → then: git add . git commit -m "resolved conflict" 2. Wrong Commit Made git reset --soft HEAD~1 3. Lost Changes git stash git stash apply 4. Check Who Changed What git blame <file> Key Learning Git is not just a tool. It’s your safety net, audit system, and collaboration engine. In production, debugging often starts from Git, not from code. Final Thought A single commit can: - Break production - Or save hours of debugging So always: Commit smart. Review carefully. Deploy confidently. #Git #DevOps #Troubleshooting #VersionControl #Cloud #Git Lab #MLOPS #devsecops
To view or add a comment, sign in
-
-
📝 Day 5 of Sharing my DevOps Series... *Git Basics What is Git? Git is a distributed version control system used to: Track code changes Collaborate with teams Manage project history *Why Git is Used? Track code changes Maintain version history Work with multiple developers Rollback to previous versions Work in parallel using branches *Git Architecture Working Directory Where you create/edit/delete files Staging Area Middle layer between working directory & Local repository Stores changes before commit Git Repository Stores all versions, history & metadata Initialize repository git init Check status git status Add file to staging git add file.txt Commit changes git commit -m "First commit" *File States in Git Untracked → New file (not added) Modified → Changed but not staged Staged → Ready to commit *Commands ls # List files ls -a # Show hidden files mkdir folder # Create directory cd folder # Change directory *Git Commit Options git commit -m "message" # Normal commit git commit -am "message" # Add + commit (tracked files only) *What is a Branch? A branch in Git is used to work on features independently without affecting the main code. *List Branches git branch - Shows all available branches Create a New Branch - git branch dev Creates a new branch named dev *Switch Branch git checkout dev git switch dev Move from one branch to another Create + Switch (Shortcut) git checkout -b feature Delete Branch git branch -d dev Deletes branch (safe delete) git branch -D dev Rename Branch git branch -m old-name new-name Rename a branch View All Branches (Local + Remote) git branch -a *Git Logs git log # Full history git log --oneline # Short history *Remote Repository (GitHub) git remote add origin <repo_url> git push origin master- Push local commits to remote repository *main information about git: git init → Initialize repo git add → Stage changes git commit → Save changes git status → Check status git branch → Manage branches git merge → Combine branches git push → Upload to remote git clone → Copy repo #DevOps #CareerGrowth #Cloud #AWS #Infrastructure #CloudComputing #AWS #TechLearning #DevOps #LearningInPublic #TechJourney #git #github
To view or add a comment, sign in
-
-
🚀 DevOps Day 21 — Git Branching & DevOps Workflow (Part 3) After fixing networking issues, I moved into real Git workflows. This is where Git becomes powerful. SSH vs HTTPS Git Connections I explored both methods: SSH Method git@github.com:nixhal33/DevOps-Mastery.git Advantages: ✔ No repeated authentication ✔ Secure ✔ DevOps-friendly HTTPS Method (Token Based) git clone https://@github.com/repo.git Steps: • Create Classic Token • Clone repo • Push changes But SSH felt more DevOps-aligned. Git Commands I Practiced ✔ git status ✔ git diff ✔ git add ✔ git commit ✔ git push ✔ git restore ✔ git revert HEAD These commands helped me: • Track changes • Revert mistakes • Monitor code differences Git Branching (Most Important Learning) Production branch: main Development branch: git checkout -b dev Workflow: Create dev branch Make changes Push to dev Merge to main Merge Conflict Practice I intentionally: • Edited files in two branches • Created merge conflict • Resolved manually • Merged successfully This was real-world Git learning. Final DevOps Insight My instructor shared something interesting: DevOps Engineers don't use Git as heavily as developers… But Git is critical for: ✔ CI/CD pipelines ✔ Automation workflows ✔ Infrastructure versioning And now I'm ready for: 🚀 Next Topic: Docker From IaC → Version Control → Containers The DevOps journey continues. you can checkout my github repo using this link: https://lnkd.in/gjw9Fuxe #DevOps #Git #GitHub #Automation #CI_CD #InfrastructureAsCode #DockerJourney #LearningInPublic
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development