🚀 Day 25 – Git Reset vs Revert & Branching Strategies Today was all about fixing mistakes the right way in Git 🔧 Hands-on with Git Reset: 🔹 Explored --soft, --mixed, and --hard 🔹 Learned how each affects commits, staging, and working directory 🔹 Understood why --hard is destructive 🔄 Git Revert: 🔹 Reverted a specific commit safely 🔹 Learned that history is preserved (no deletion) 🔹 Realized why revert is preferred for shared branches Reset vs Revert: Reset = rewrite history Revert = create a new undo commit Revert is safer for collaboration Branching Strategies: 🔸 GitFlow – structured, multiple branches 🔸 GitHub Flow – simple and fast 🔸 Trunk-Based Development – short-lived branches, fast integration Key Takeaways: Never use reset --hard on pushed code Use revert when working in teams Branching strategy depends on team size & release cycle #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Git #GitHub #DevOps #LearningInPublic #TechJourney #SoftwareEngineering #Cloud #OpenSource #DeveloperJourney #BuildInPublic #CareerGrowth #EngineeringLife #Linux #Automation #CI_CD
Git Reset vs Revert & Branching Strategies for DevOps
More Relevant Posts
-
⚔️ Git Merge vs Rebase — Choosing the Right Strategy Matters When working with Git in collaborative environments, one common question comes up: Should we use Merge or Rebase? Both achieve the same goal — integrating changes — but the impact on commit history and team workflow is very different. 🔹 Git Merge • Preserves complete commit history • Creates a merge commit • Easier for team collaboration • Safer for shared branches • Useful for tracking feature integration 🔹 Git Rebase • Creates a linear commit history • No extra merge commits • Cleaner project timeline • Easier to read history • Ideal for local branch cleanup 💡 When to Use Merge Shared branches, Team-based feature integration, Production-safe workflows , When history transparency matters 💡 When to Use Rebase Cleaning local commits , Before creating Pull Requests , Maintaining linear history , Small feature branches ⚠️ Golden Rule Never rebase public/shared branches — it rewrites history and can break collaboration. Choosing the right strategy improves: 🚀 Code readability , Team collaboration , CI/CD workflows , Release management What does your team prefer — Merge commits or Rebase workflow? #DevOps #Cloud #Git #Github #VersionControl #CICD #CloudTechs #BranchingStrategy #CloudComputing #AWS #Docker #Code #Automation #Linux #TechCareers #ContinuousLearning #Openwork #BuildingConnections #CloudComputing #VersionControl
To view or add a comment, sign in
-
-
Git is more than just a tool — it's the heartbeat of every DevOps pipeline. 💓 After covering Linux fundamentals, I went deep on Git. Not just reading docs — I practiced 23 essential commands hands-on, documenting every terminal output and GitHub workflow along the way. 🛠️ 📚 What's inside the hands-on guide? 1️⃣ Foundation — Installation on Ubuntu + identity setup with git config. 2️⃣ Core Workflow — Mastering the flow: Working Directory → Staging → Local Repo → Remote. 3️⃣ Branching — Managing dev and prod branches like a professional environment. 4️⃣ Recovery Tools — git stash for work-in-progress and git cherry-pick for surgical fixes. 5️⃣ History Control — Knowing exactly when to use --soft vs --hard reset. 💡 3 things I learned by intentionally breaking Git: The Golden Rule: 1. Always pull before you push. I triggered a push rejection on purpose — by adding a file directly on GitHub — and resolved the conflict step by step. That 10 minutes taught me more than hours of reading. 2. Visualize the tree. git log --oneline --graph is your best friend. If you can’t see the branch structure, you don’t truly control the flow. 3. Commit with intent. Small, frequent commits with clear messages beat one massive "final update" every time — especially when something breaks and you need to roll back. I'm sharing the wealth! 👇 Attached major command reference guide with real terminal screenshots and GitHub workflow documentation. I hope this helps anyone else on the DevOps path. #Git #GitHub #DevOps #VersionControl #Linux #CloudComputing #LearningInPublic #Automation #SoftwareEngineering #TechSkills
To view or add a comment, sign in
-
📌 Continuing my DevOps Journey — this time with Git & GitHub! Git is the backbone of every modern development workflow. No Git = no DevOps. Here's what I covered: ✅ How Git works — Working Directory → Staging → Local Repo → GitHub ✅ Core commands — init, add, commit, push, pull, log, status ✅ Branching & Merging — and handling conflicts ✅ Stash, Reset & Revert — undoing changes the right way ✅ Tags, Clone & .gitignore ✅ Pull Requests — reviewing before merging Every DevOps pipeline starts with a git push. Now I actually understand what happens after that. 🚀 #DevOps #docker #linux #Git #GitHub #VersionControl #CloudEngineering #cheatsheet
To view or add a comment, sign in
-
-
𝗗𝗮𝘆 𝟮𝟯 𝗼𝗳 𝗺𝘆 𝗗𝗲𝘃𝗢𝗽𝘀 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 💻 Working safely on shared code — forked a repository to create an independent development copy 🍴 𝗧𝗮𝘀𝗸: Fork a Git Repository (Gitea) 𝗪𝗵𝗮𝘁 𝗜 𝗹𝗲𝗮𝗿𝗻𝗲𝗱 𝘁𝗼𝗱𝗮𝘆: • Difference between fork and clone • Why forking is used in collaborative development • How forks allow independent changes without affecting the original repo • Basics of Git workflows using UI tools like Gitea • Foundation of pull request-based collaboration 𝗪𝗵𝗮𝘁 𝗜 𝗯𝘂𝗶𝗹𝘁 / 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝗱: • Accessed Gitea UI from the environment • Logged in as user `jon` • Located repository `sarah/story-blog` • Forked the repository under Jon’s account • Verified new repo `jon/story-blog` 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀: • Understanding when to use fork vs clone • Navigating UI-based Git workflows 𝗙𝗶𝘅 / 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴: • Learned that fork creates a server-side copy under a new user • Understood how it enables safe experimentation • Got clarity on how teams collaborate using forks + pull requests 𝗞𝗲𝘆 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆: Forking is essential for safe collaboration — it lets developers experiment freely without risking the original codebase. This felt like stepping into a real team-based Git workflow 🚀 Do you prefer fork-based workflows or direct collaboration on shared repositories? #Day23 #DevOps #Git #VersionControl #Gitea #Linux #Automation #CloudComputing #AWS #DevOpsJourney #LearningInPublic #100DaysOfDevOps
To view or add a comment, sign in
-
-
𝗗𝗮𝘆 𝟮𝟮 𝗼𝗳 𝗺𝘆 𝗗𝗲𝘃𝗢𝗽𝘀 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 💻 Bringing code to life — cloned a Git repository to create a working copy for development 📥 𝗧𝗮𝘀𝗸: Clone Git Repository on Storage Server 𝗪𝗵𝗮𝘁 𝗜 𝗹𝗲𝗮𝗿𝗻𝗲𝗱 𝘁𝗼𝗱𝗮𝘆: • Difference between bare repository and working repository • How `git clone` creates a local working copy • Cloning repositories from local paths (not just GitHub) • Importance of using correct user permissions • Safe handling of shared repositories in production environments 𝗪𝗵𝗮𝘁 𝗜 𝗯𝘂𝗶𝗹𝘁 / 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝗱: • Logged into Storage Server (`ststor01`) as `natasha` • Verified existence of repository `/opt/games.git` • Created destination directory `/usr/src/kodekloudrepos` • Cloned repository using `git clone /opt/games.git` • Verified working copy using `git status` 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀: • Understanding local path-based cloning • Ensuring no permission or structure changes were made • Being careful to use the correct user (`natasha`) 𝗙𝗶𝘅 / 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴: • Learned that cloning from local repositories works the same as remote • Understood importance of maintaining repository integrity • Gained clarity on how working copies are used in development 𝗞𝗲𝘆 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆: Cloning is where development begins — it bridges the gap between a central repository and actual coding work. This felt like a real-world Git workflow setup 🚀 Do you mostly clone from local repos, GitHub, or enterprise tools like GitLab/Bitbucket? #Day22 #DevOps #Git #VersionControl #Linux #Automation #CloudComputing #AWS #DevOpsJourney #LearningInPublic #100DaysOfDevOps
To view or add a comment, sign in
-
-
Going from git push to a live production container - all on my own hardware. 🛠️ I recently shared a project I built for media processing. While the app itself was fun, deploying updates to my self-hosted environment was painful: manually build and push a new docker file, SSH into the server, pull the new image, spin up the new container. I wanted to streamline this process with professional-grade CI/CD pipeline, this was the real playground. The Pipeline: 1. Version Control: Code pushed to GitHub. 2. CI: GitHub Actions triggers an Ubuntu VM to build from my Dockerfile. 3. Registry: The fresh image is pushed to my public Docker Hub repository. 4. The "Handshake": GitHub Actions hits a custom Webhook Server I wrote running on my home lab. 5. CD: My server pulls the latest image and restarts the container automatically. Was a full CI/CD pipeline necessary for a tool used by exactly two people? Probably not. But building it taught me more about the "plumbing" of DevOps - like handling GitHub actions, securing all my secrets!! webhooks and Docker registries - core concepts i can apply to future development, all while having fun building something simple. And most importantly, removing friction from my own workflow with one-click deployment. The biggest hurdle? It wasn't the Webhook server or the Docker orchestration. It was spending longer than i care to admit figuring out why my test downloads were "corrupted" on my Linux machine, only to realize I just needed to install VLC to support the MP4/MKV codecs. Sometimes the "bug" is just your media player! 😂 It’s not just about the final tool; it’s about having a playground to break things and fix them. #DevOps #Docker #GithubActions #SelfHosted #HomeLab #BackendEngineering
To view or add a comment, sign in
-
-
Week 3 done. This one hit different. Git isn't just commands—it's how real teams collaborate without breaking production. I simulated a complete Git Flow this week: feature branches, release branches, hotfix workflows. Seeing that full branch graph with merges, tags, and proper history was satisfying. Then came Day 11. My first comprehensive exam covering everything from Linux to Git. Twenty questions, ten hands-on tasks, real-world scenarios. Passed with 90%. But here's what mattered more: when the exam had questions on topics we hadn't covered, I called it out. Not rudely, just directly. My teacher listened, apologized, and changed the rule: "Only test what's been taught." Small win, but it felt important. Quick wins this week: Resolved my first merge conflict (those <<<<<<< markers make sense now) Learned git stash for context switching Ran a complete hotfix simulation (v1.0 → v1.0.1) 36+ scripts now on GitHub My portfolio is live at https://lnkd.in/ggFmPwEm. Next week: Docker. If you're learning DevOps—don't just watch tutorials. Break things. Fix them. Document it. That's where learning happens. #DevOps #Git #LearningInPublic #DevOpsJourney #CareerTransition
To view or add a comment, sign in
-
-
GitHub or GitLab? I hear this question all the time: “Which one should we use?” My honest answer? Both are excellent they just approach the problem differently. 🔵 GitHub It stands out because of its ecosystem and community. It’s the go-to platform for open source, collaboration, and developer experience. With GitHub Actions, automation is powerful and flexible especially if you like building things step by step. 🟠 GitLab More opinionated. More “all-in-one.” Code, CI/CD, security scanning, artifacts, deployments everything lives in one place. Great if you want a single platform that covers the full DevOps lifecycle out of the box. The real difference isn’t the tool. 👉 It’s the mindset. GitHub fits teams that value flexibility and ecosystem. GitLab fits teams that want an integrated DevOps platform. Both can scale. Both can be secure. Both can power production systems. The real question is: Which one fits your team, your culture, and the way you work? Are you more GitHub or GitLab and why? #DevOps #Git #CICD #Engineering #GitHub #GitLab
To view or add a comment, sign in
-
-
GitHub or GitLab? I hear this question all the time: “Which one should we use?” My honest answer? Both are excellent they just approach the problem differently. 🔵 GitHub It stands out because of its ecosystem and community. It’s the go-to platform for open source, collaboration, and developer experience. With GitHub Actions, automation is powerful and flexible especially if you like building things step by step. 🟠 GitLab More opinionated. More “all-in-one.” Code, CI/CD, security scanning, artifacts, deployments everything lives in one place. Great if you want a single platform that covers the full DevOps lifecycle out of the box. The real difference isn’t the tool. 👉 It’s the mindset. GitHub fits teams that value flexibility and ecosystem. GitLab fits teams that want an integrated DevOps platform. Both can scale. Both can be secure. Both can power production systems. The real question is: Which one fits your team, your culture, and the way you work? Are you more GitHub or GitLab and why? #DevOps #Git #CICD #Engineering #GitHub #GitLab
To view or add a comment, sign in
-
-
Think twice before you hit 'sync' on GitHub. GitHub sync is a permanent step. It's crucial to understand the implications before turning it on. Take this seriously to maintain clarity in your workflow and avoid irreversible changes. Proceed with knowledge, not haste. Dive deeper into version control fundamentals! #GitHub #VersionControl #CodeQuality
To view or add a comment, sign in
Explore related topics
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