Day 25 of my DevOps & Git journey — and today hit different. 🚀 I learned how to UNDO mistakes in Git — one of the most important (and most feared) skills for any developer. 🔁 Git Reset vs Git Revert These two commands look similar but behave very differently: → git reset --soft → Undo commit, keep changes staged → git reset --mixed → Undo commit, keep changes unstaged → git reset --hard → Undo commit, DELETE the changes forever → git revert → Undo safely by creating a NEW commit (safe for teams) The golden rule I learned today: Never use git reset on commits that are already pushed to a shared branch. Use git revert instead — it's safe, traceable, and won't break your teammates' work. 🌿 Branching Strategies used by real engineering teams I also researched how actual companies manage code at scale: ✅ GitFlow — Multiple branches (main, develop, feature, release, hotfix). Great for large teams with scheduled releases. ✅ GitHub Flow — Just main + feature branches. Simple, fast, perfect for startups shipping daily. ✅ Trunk-Based Development — Everyone commits to main. Used by Google, Meta, Netflix. Needs strong CI/CD and feature flags. Fun fact: React (by Meta) uses GitHub Flow — anyone in the world can fork it, fix a bug, and open a PR. Open source in action! 🌍 📁 Everything is documented in my GitHub repo: → day-25-notes.md with hands-on observations → git-commands.md updated with all commands from Days 22–25 [🔗https://lnkd.in/gCdzzCe4] [🔗 https://lnkd.in/gCKd7wqe] #Git #DevOps #90DaysOfDevOps #OpenSource #GitHub #LearningInPublic #Developer #BuildingInPublic #TrainWithShubham
Git Undo Mistakes: Git Reset vs Git Revert
More Relevant Posts
-
🚀 #100DaysOfAWS – Day 7 | Revisiting Advanced Git Concepts As part of my #100DaysOfAWS journey, today was more of a refresher on advanced Git concepts that I’ve worked with before — revisiting them with a deeper understanding and practical perspective. Sometimes going back to fundamentals with experience helps connect the dots better, especially in real-world workflows. 🔹 What I revisited today: Branching & Navigation: • git branch – Managing multiple lines of development more efficiently • git checkout – Switching context between features and fixes Merging Strategies (with better clarity now): • git merge – Useful for preserving complete history in collaborative environments • git rebase – Helps maintain a clean, linear history when used carefully 👉 Now I better understand when to use what instead of just how: • Merge for team-safe integration • Rebase for cleaner history (especially in personal branches) Handling Work in Progress: • git stash – Still one of the most underrated commands for quick context switching • git apply – Helpful when reapplying specific changes without full stash pop Working with Remotes: • git pull – Not just pulling, but understanding it as fetch + merge • git push – More mindful about pushing clean and meaningful commits Undo with Confidence: • git revert – Safer way to undo changes without breaking history ⸻ 💡 Key takeaway: Revisiting Git with experience gives a new level of clarity — it’s no longer just about commands, but about making the right decisions in the workflow. The goal is not just to use Git, but to use it cleanly, safely, and efficiently in team environments. #Git #DevOps #AWS #VersionControl #100DaysOfCode #LearningJourney #FLM
To view or add a comment, sign in
-
🚀 DevOps Journey – Day 19 / 100 Today I learned Git Tags, Fork, Merge Conflicts & Bitbucket 🔥 ⸻ 🔹 🏷️ Git Tags (Versioning) 👉 Tags are like milestones / backups in Git 📌 Example: Version1 → 3 commits Version2 → 2 more commits Version3 → 2 more commits 👉 We can mark versions like: • app-v1 • app-v2 • app-v3 ⸻ 🔹 🧪 Hands-on Example mkdir project cd project git init touch file1 file2 file3 git add file1 git commit -m "file1 commit" git add file2 git commit -m "file2 commit" git add file3 git commit -m "file3 commit" 👉 Apply tags: git tag app-v1 git tag git log 👉 Push tag to GitHub: git push origin app-v1 git push origin --tags 🔹 🍴 Git Fork 👉 Fork = Copy of someone else’s repo into your GitHub 📌 Steps: 1. Click Fork in GitHub 2. Repo copied to your account 3. Clone → Make changes → Push 💡 Used in open source contributions ⸻ 🔹 ⚠️ Merge Conflicts (Real-Time) 👉 When 2 people change same file/line → Conflict 🎬 Example: Tillu & Shanon both ask Radhika for movie at 1:30 PM 😅 👉 Same time → Conflict 💡 Solution: • Manually edit file • Remove conflict markers • Commit resolved code ⸻ 🔹 🔁 Git Alternatives • Bitbucket • Azure Repos • AWS CodeCommit ⸻ 🔹 🔵 Bitbucket Basics 👉 Same as GitHub (Repo hosting) 📌 Workflow: • Create repo • Clone repo • Create branch • Commit changes • Push & Pull ⸻ 🔹 🔐 Bitbucket Token (App Password) 📌 Steps: • Go to Settings → Access Management • Create App Password / API Token • Set permissions (read/write) • Use instead of password ⸻ 💡 Pro Tip: Use tags for releases, forks for contributions, and always resolve conflicts carefully! You’re now thinking like a real DevOps Engineer 🚀 #DevOps #Git #GitHub #Bitbucket #VersionControl #100DaysOfDevOps #LearningJourney #Cloud #Automation #RealTime #flm #frontlinemedia #reach #edutech Frontlines EduTech (FLM)
To view or add a comment, sign in
-
-
📝 Day 6 Sharing my DevOps Series..... *git config is used to set and manage Git settings like your username, email, editor, and more. git config --global user.name "Your Name" git config --global user.email "your@email.com" *View commit history git log git log --oneline *Git Branch git branch git branch feature git checkout feature Branch = separate workspace *Git Merge - Combine changes git merge feature Merges feature branch into main Watch for conflicts *Git Clone Copy a repository git clone <repo-url> Downloads project to your system *Git Pull vs Fetch git fetch git pull Fetch = download changes Pull = fetch + merge *Git Push Upload your code git push origin main Sends commits to remote repo *Git Tag Mark important versions git tag v1.0 git push origin v1.0 Useful for releases *Git Stash Save work temporarily git stash git stash pop Useful when switching tasks *Git Rebase vs Merge Two ways to integrate code Merge → keeps history Rebase → cleaner history git rebase main *Git Fork (GitHub Workflow) Post: Contribute to open source Fork → copy repo Clone → local copy Push → your repo PR → contribute git cherry-pick git cherry-pick is used to pick a specific commit from one branch and apply it to another branch. git cherry-pick <commit-id> #GitHub #OpenSource #DevOps #git #cloud #repository.....
To view or add a comment, sign in
-
-
𝗚𝗶𝘁 𝗕𝗿𝗮𝗻𝗰𝗵𝗶𝗻𝗴 𝗦𝘁𝗿𝗮𝘁𝗲𝗴𝗶𝗲𝘀 𝘀𝗼𝗺𝗲𝘁𝗵𝗶𝗻𝗴 𝗜 𝘂𝗻𝗱𝗲𝗿𝘀𝘁𝗼𝗼𝗱 𝗼𝗻𝗹𝘆 𝗿𝗲𝗰𝗲𝗻𝘁𝗹𝘆 When I started using Git, I honestly thought branching simply means "create branch, push code, done." That's it. Job over. But while working on actual projects, one thing hit me hard. The wrong branching strategy does not just cause small hiccups. It creates confusion that keeps piling up and becomes very difficult to manage later. So let me share what I understood, in simple words. 𝗠𝗮𝗶𝗻 𝗼𝗿 𝗧𝗿𝘂𝗻𝗸-𝗕𝗮𝘀𝗲𝗱 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗺𝗲𝗻𝘁: Everyone commits directly to one main branch with small, frequent updates. Simple to follow, but it needs a lot of discipline from every single person on the team. 𝗙𝗲𝗮𝘁𝘂𝗿𝗲 𝗕𝗿𝗮𝗻𝗰𝗵𝗶𝗻𝗴: Every feature gets its own separate branch. Once the work is done, it gets merged back to main. Very easy to manage and track, and honestly the most commonly used approach in most teams I have seen. 𝗚𝗶𝘁 𝗙𝗹𝗼𝘄: This one has dedicated branches for everything, main, develop, feature, release, hotfix. Slightly more process-heavy but very useful once your project or team starts growing. 𝗥𝗲𝗹𝗲𝗮𝘀𝗲 𝗕𝗿𝗮𝗻𝗰𝗵𝗶𝗻𝗴: A separate branch is created for each release and all bug fixes are handled there before anything goes live. Very helpful when you want stable and controlled deployments. One thing I genuinely realised after all this is that there is no perfect branching strategy that works for everyone. It completely depends on your team size, your project, and how frequently you are shipping things. Personally, feature branching felt like the most natural starting point for me and I still use it quite often. #DevOps #Git #GitHub #CICD #VersionControl #CloudComputing #Docker #Kubernetes #AWS #Automation #LearningDevOps #DevOpsTips
To view or add a comment, sign in
-
-
📘 #100DaysOfDevOps – Day 11 (GitHub – Day 2) Today I learned about Branching and Merging in Git 🌿 Branching is one of the most powerful features of Git. It allows developers to work on different features without affecting the main code. --- 🔹 What is a Branch? A branch is a separate line of development. 👉 Default branch: "main" --- 🔹 Why Branching is Important? • Work on features independently • Avoid breaking main code • Collaborate easily with teams --- 🔹 Important Commands Create a branch "git branch feature-1" Switch to branch "git checkout feature-1" (Create + switch) "git checkout -b feature-1" View branches "git branch" --- 🔹 Merging Branches Switch to main branch "git checkout main" Merge branch "git merge feature-1" --- 🔹 Key Concept 👉 After merging, changes from feature branch are added to main branch. --- 💡 Key Learning: Branching and merging help teams collaborate efficiently, manage features, and maintain clean code in real DevOps projects. Learning something new every day 🚀 #100DaysOfDevOps #DevOps #Git #GitHub #LearningInPublic
To view or add a comment, sign in
-
-
Stop just "saving" code. Start mastering it. Whether you're a developer, a DevOps engineer, or a tech enthusiast, understanding Git and GitHub isn't just a skill—it’s the "Single Source of Truth" for modern software delivery. I’ve been diving deep into Version Control Systems (VCS) recently, and I wanted to break down the core concepts that every tech professional should have in their toolkit. Centralized vs. Distributed (CVCS vs. DVCS) Old school (SVN/Perforce) relied on one central server. If it went down, work stopped. 🛑 Modern school (Git/Mercurial) is distributed. Every developer has the full history. If the server dies, the code lives on your machine. 🛡️ Git vs. GitHub: What's the difference? Git: The engine under the hood. It’s the local software that tracks your changes. GitHub: The social club for code. It’s the cloud platform where we collaborate, review PRs, and run CI/CD pipelines. The 3 States of Git (Your Workflow Path) Understanding how code moves is key to avoiding merge nightmares: 🔹 Working Directory: Where you write and modify files. 🔹 Staging Area: The "prep zone" where you pick what changes to include. 🔹 Git Directory: The final snapshot where history is permanently recorded. Pro-Tips for the DevOps Workflow: Branching: Work in isolation (feature-login, hotfix-patch) to keep production safe. 🌿 .gitignore: Always hide your secrets! Keep node_modules and .env files out of your repo. 🔒 Forking: The ultimate way to contribute to Open Source. Copy, modify, and propose changes via Pull Request. Version control is the foundation of automation, quality, and high-velocity delivery. If you aren't using Git, you aren't doing DevOps! What’s one Git command you can’t live without? Let’s chat in the comments! 👇 #DevOps #Git #GitHub #VersionControl #SoftwareEngineering #TechLearning #CloudComputing #OpenSource #SoftwareDevelopment #CareerGrowth#DevOps
To view or add a comment, sign in
-
-
🚀 DevOps Journey – Day 16 / 100 Today I explored Git Merge vs Rebase, Stash & GitHub basics 🔥 🔹 🔁 Merge vs Rebase (Interview Perspective) ✅ Git Merge • Combines branches with a merge commit • Preserves full history • Best for team collaboration ✅ Git Rebase • Rewrites commit history linearly • Cleaner & readable history • Best for local development 💡 Difference in One Line: 👉 Merge = Safe & history preserved 👉 Rebase = Clean & linear history ⸻ 🔹 📦 Git Stash (Temporary Save) • git stash → Save uncommitted changes • git stash list → View stash list • git stash apply → Reapply changes • git stash clear → Delete all stash ⸻ 🔹 🌐 GitHub Basics • Create account on GitHub • Create a repository • Default branch = main 🔹 🔗 Connect Local to GitHub • git remote add origin <URL> • git remote -v → Verify remote ⸻ 🔹 🚀 Push Code • git push origin branch • git push origin --all 💡 Note: Using HTTPS → Requires username + personal access token (PAT) instead of password ⸻ 🔥 Pro Tip: Use Merge in real projects, Rebase for clean commits before pushing! Consistency + Practice = DevOps Success 💪 #DevOps #Git #GitHub #Linux #VersionControl #100DaysOfDevOps #LearningJourney #Cloud #Automation #selflearning #devops #software
To view or add a comment, sign in
-
-
Most developers use Git daily… but only scratch the surface. If you’re serious about DevOps or backend development, mastering Git isn’t optional — it’s essential. Here are some must-know Git commands that should be part of your daily workflow: 🚀 Basics git init | git clone | git status | git add | git commit 🌿 Branching & Switching git branch | git checkout | git switch | git merge ⚡ Advanced Operations git rebase | git cherry-pick | git reset | git revert 🔄 Remote Work git push | git pull | git fetch | git remote 🧰 Debugging & History git log | git diff | git show | git blame 📦 Stashing & Cleanup git stash | git stash pop | git clean ⚙️ Configuration git config | git alias | git help Mastering these commands helps you: ✔ Work faster ✔ Avoid mistakes ✔ Collaborate better with your team Don’t wait for a PR review to realize what you’re missing. 💡 Keep learning. Keep improving. #Git #DevOps #SoftwareDevelopment #Backend #Programming #Developers #Learning #CareerGrowth
To view or add a comment, sign in
-
Day 2 of actually learning Git properly. My CS degree gave me a lot—algorithms, data structures, the whole nine yards. But version control? We touched it once and called it a day. So here I am, playing catch-up. Learned about git config—turns out Git needs to know who you are before it lets you do anything. Simple, but somehow I never stopped to think about why my commits were always showing up with the wrong name. Also finally understand the difference between tracked and untracked files. Sounds basic, I know. But I used to just git add . everything like a caveman and hope for the best. On top of that, I started reading about the DevOps lifecycle. Interesting stuff, but honestly? Theory is great, but actually managing code with a team? That's a different beast entirely. Small steps. But at least now when I break something, I'll know who's to blame (me, it's always me). What's a basic Git thing that took you embarrassingly long to figure out? Asking so I don't feel alone here. #DevOps #Git #ComputerScience #LearningInPublic #Day2
To view or add a comment, sign in
-
Part-1: 🚀 Git Roadmap: From Fresher to Intermediate (Step-by-Step Guide) Git is not just a tool — it’s a must-have skill for every developer & DevOps engineer. If you're starting your journey or struggling with Git concepts, this roadmap will help you learn Git in a structured and easy way 👇 🟢 1. Getting Started What is Git & why it matters Install Git Configure your identity git config --global user.name "Your Name" git config --global user.email "your@email.com" 🔵 2. Basic Workflow (Core Commands) git init → Initialize repo git status → Check changes git add . → Stage changes git commit -m "message" → Save changes git log → View history 👉 Master this section — it's used daily! 🟡 3. Branching & Merging git branch → Create/list branches git checkout -b feature → New branch git switch → Move branches git merge → Combine branches 💡 This is where real teamwork starts! 🟣 4. Remote Repositories GitHub / GitLab / Bitbucket git remote add origin <url> git push -u origin main git pull 🤝 Learn collaboration & PR workflow 🔴 5. Undoing Changes git checkout -- file git reset (soft/mixed/hard) git revert ⚠️ Important: Know when to use what! 🟠 6. Intermediate Concepts .gitignore → Ignore files git stash → Save temporary work Rebase vs Merge Interactive rebase Clean commit history ⭐ Best Practices ✔ Write meaningful commit messages ✔ Commit small & frequently ✔ Always pull before push ✔ Use branches for features ✔ Review before merging 🎯 Goal Become confident with Git, collaborate smoothly, and never lose your code again 💪 📌 Tip: Don’t just read — practice daily on real projects! 💾 Save this post for later & follow for more DevOps content. #Git #DevOps #VersionControl #Developer #LearnInPublic #TechRoadmap #Cloud #Programming
To view or add a comment, sign in
-
More from this author
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