Deleted from Git… but not really gone 👀 You delete a file, commit & push — feels clean. But It’s not. That data still lives in your repo history, Inside .𝗴𝗶𝘁 across every machine that already pulled it. Yes, even that accidental '𝘹'GB file. Git doesn’t forget — it snapshots. Deleting removes it from the current state, not from existence. If you actually want it gone, you need to rewrite history, force push, and clean up everywhere. Anything less is just optics. Commit like it’s permanent. Because in Git, it basically is. #Git #BackendEngineering #DevOps #SystemDesign
Git Deletes, But Doesn't Forget: Understanding Git History
More Relevant Posts
-
Writing clear Git Commit messages isn't just about being organized, it’s about making life easier for your future self and your teammates. I have started using the Conventional Commits specification to keep things consistent and clear. It is a super simple way to make code reviews faster and project histories actually readable Check out the link below in comments #git #github #devops #software #webdevelopment #fullstack
To view or add a comment, sign in
-
🚀 Day 13 of #100DaysOfDevOps Today I explored some powerful Git commands that help in better code management and recovery: 🔹 Config – Set up Git username, email, and preferences 🔹 Ignore – Avoid tracking unnecessary files using .gitignore 🔹 Amend – Modify the last commit (message or changes) 🔹 Reset – Undo changes and move to a previous state 🔹 Reflog – Track all Git actions and recover lost commits 🔹 Cherry-pick – Apply a specific commit from one branch to another 💡 These commands are very useful in real projects for fixing mistakes, managing commits, and maintaining clean history. 📌 Learning step by step, improving every day! #DevOps #Git #VersionControl #LearningJourney #TechSkills #100DaysOfCode
To view or add a comment, sign in
-
-
I wasted 6 months using Git the wrong way. No one told me this… Git is not just: → add → commit → push That’s barely scratching the surface. The real power of Git is hidden in commands most developers never touch: ⚡ git stash → save your work instantly ⚡ git rebase → make your commits look clean & professional ⚡ git bisect → find the exact bug in minutes ⚡ git cherry-pick → move changes without breaking things ⚡ git push --force-with-lease → avoid team disasters Once I learned these, everything changed: → Less confusion → Faster debugging → More confidence in production Honestly… I wish I knew this earlier. So I built something for developers like me: A complete Git + DevOps cheat sheet (100+ commands) If you want it: Comment “GIT” I’ll send it to you 📩 Let’s see how many developers are serious about leveling up 👇 #DevOps #Git #SoftwareEngineering #Coding #TechCareers
To view or add a comment, sign in
-
🚀 𝟗𝟎 𝐃𝐚𝐲𝐬 𝐨𝐟 𝐃𝐞𝐯𝐎𝐩𝐬 | 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐢𝐧 𝐏𝐮𝐛𝐥𝐢𝐜 | 𝐇𝐚𝐧𝐝𝐬-𝐎𝐧 | 𝐏𝐫𝐨𝐣𝐞𝐜𝐭𝐬 🌳 Branching out into Version Control: My First Git Repo! Day 22 of #90DaysOfDevOps is done! ✅ Today, I transitioned from scripting to mastering Git—the absolute backbone of DevOps and modern software engineering. 👨💻 I set up my global config, initialized my first repository, and got hands-on with the core workflow: Working Directory ➡️ git add (Staging) ➡️ git commit (Repository). ✅ git init → git add → git commit → Repeat! 💡 Biggest Aha! Moment: Understanding the Staging Area. It isn’t just an extra annoying step; it’s a drafting space that lets you group related changes together before sealing them into a commit, keeping the project history clean and logical! 🔗💻 GitHub Repo: https://lnkd.in/dZsmFiQT #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Git #GitHub #VersionControl #DevOpsJourney
To view or add a comment, sign in
-
💬 Git Debate: Rebase vs Squash – What do you prefer? When managing commits and keeping history clean, what’s your go-to approach? 🔘 Rebase – Clean, linear history 🔘 Squash – Single, tidy commit 🔘 Merge – Keep full commit history 🔘 Depends on use case 🧠 Let’s see what developers prefer and why! #Git #DevOps #VersionControl #Developers #CodingPoll
To view or add a comment, sign in
-
Git Series | Day 3 🔄 I used to think merging branches was complicated. Turns out, sometimes Git just... slides. Today I learned about Fast-Forward merges — and it genuinely changed how I think about branch history. Here's the simple mental model: → You create a feature branch off master → You do your work (f1, f2) → Meanwhile, master hasn't moved → Git doesn't need a new commit — it just moves the master pointer forward to f2 That's it. Clean. Linear. No mess. Why does this matter in DevOps? In a CI/CD pipeline, a clean git log isn't just aesthetic — it's operational. Auditing deployments, tracing bugs, rolling back changes — all of it gets harder when your history is tangled. Fast-forward = linear history = fewer headaches in production. Day 3 done. Building one concept at a time. 🚀 #Git #DevOps #100DaysOfCode #VersionControl #CI/CD
To view or add a comment, sign in
-
-
Day 25 of learning and practicing DevOps🔄 Focused on one of the important Git skill — undoing mistakes Worked on • Understanding git reset with soft, mixed and hard modes • Learning how git revert safely undoes changes without breaking history • Comparing reset vs revert in real scenarios • Exploring branching strategies like GitFlow, GitHub Flow and Trunk-Based • Understanding when to use each strategy in real projects Important part : git reset can rewrite history and even delete changes git revert creates a new commit and keeps everything safe Learning today: Reset is for local cleanup Revert is for team safety Branching strategy defines how a team builds, releases and collaborates Here are my notes https://lnkd.in/gr5CNBTU 🌐 #DevOps #Git #VersionControl #LearningInPublic #90DaysOfDevOps #TrainWithShubham
To view or add a comment, sign in
-
🚀 𝙄 𝙎𝙩𝙤𝙥𝙥𝙚𝙙 𝙐𝙨𝙞𝙣𝙜 𝙁𝙪𝙡𝙡 𝙂𝙞𝙩 𝘾𝙡𝙤𝙣𝙚 𝙞𝙣 𝙋𝙧𝙤𝙙 𝘿𝙚𝙗𝙪𝙜𝙜𝙞𝙣𝙜 — 𝙃𝙚𝙧𝙚’𝙨 𝙒𝙝𝙮 Most engineers default to: 👉 git clone <repo> (full clone) But during a recent production issue, I realized something powerful 👇 🔴 Scenario: Latest deployment → ❌ Failed Previous version → ✅ Working Instead of pulling the entire repo history, I used: 👉 git clone --depth 2 <repo> ⚡ Why this worked: Gave me just the last 2 commits 🔸 Allowed quick comparison: 🔹 What changed? 🔸What broke? 🔹Saved time ⏱️ (no heavy clone) 🔸Faster root cause identification 💡 Pro Tip: If needed, you can always expand later: git fetch --deepen=5 git fetch --unshallow 🎯 Key Insight: “Debug present → go shallow Debug past → go deep” 🔥 One-liner I now follow: 👉 For production failures after a recent deployment, start with --depth 2 to compare the last known good and failing commit—then deepen history only if needed. Below image for an example with comparison of full clone vs shallow clone with last 1 commit. full clone gave 4402 objects whereas shallow gave 360 of the last latest commit. Meet you in next writeup 🤝 #DevOps #AzureDevOps #Git #SRE #CloudEngineering #Debugging #Productivity #Azure
To view or add a comment, sign in
-
-
🗓️ Day 27/100 — 100 Days of AWS & DevOps Challenge Today's task: a bad commit was pushed to a shared repository. Undo it cleanly. The instinct for many engineers - especially under pressure is to reach for git reset --hard. That's the wrong tool the moment a commit has been pushed to a shared branch. Here's why. git reset rewinds the branch pointer backward, effectively deleting commits from history. Locally, that looks clean. But the remote still has those commits. Now your local master and origin/master have diverged. Git rejects your push. You force push. And now every team member whose local clone was based on those commits has a broken repository. git revert solves this correctly: $ git revert --no-commit HEAD $ git commit -m "revert games" $ git push origin master Instead of deleting the bad commit, it creates a new commit that contains the exact inverse of the bad commit's changes. The bad commit stays in history, it didn't disappear. But HEAD now points to a commit that cancels it out, and the working tree is back to the state before the bad commit was applied. No history rewriting. No force push. No broken clones. Just an auditable record that says "we made a mistake, here's the correction, and when." The --no-commit flag is important here because the task required a specific commit message - "revert games". Without it, Git auto-generates a message like Revert "some commit message". Using --no-commit stages the changes without committing, letting us then git commit -m "revert games" with full control over the message. This exact workflow is what you'd run during a production rollback and why every team's runbook should say git revert, not git reset. Full breakdown on GitHub 👇 https://lnkd.in/gVY8q4u4 #DevOps #Git #VersionControl #GitOps #100DaysOfDevOps #KodeKloud #LearningInPublic #CloudEngineering #SRE #Rollback #Infrastructure
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
Great… Informative 👑