If you are a developer, I hope that this helps you ! I've faced a issue quite sometimes when you are working on a feature, and someone just comes up with an urgent modification to production or bug fix. Usually I'm used to stashing my work, or doing a commit that I would over-ride later with an amend commit, but that makes me have to see if I stashed or commited my changes, finding the right stash if I stashed more times than one, or checking if I have to amend. Another thing thing that I noticed sometimes where I had to debug an issue, and I would be comparing a good state commit with a bad state commit, checking out into them, running the server, and comparing what has changed using a debugger. This was pretty tiresome, since if you don't find the issue right away, you had to switch multiple times, and build and run the server if there's no hot-reload (My backend in go didn't have those), and then compare. I should have just cloned the repo again, and run on another port to compare, but this old thing in git that I found is much better. While creating a design for a new project I'm working on, I came across git worktrees, and noticed that I can use them in my regular workflow as well. Just need to add a worktree, and it makes a copy of my code for local running, that I can host on another port, which allows me to run the 2 servers side by side to debug them up. Also, I just create a worktree if someone disturbs me to switch context, and then later am able to return to what I was working on. This is something that you might be able to also use when you have a monorepo, and need to run different versions for different microservices. Do explore it, it's a nice ignored feature in git. You'll be hooked. #Git #WebDev #SoftwareEngineering #CodingTips #Programming #DeveloperExperience #DX #ProductivityHacks #CleanCode #WorkflowOptimization #GitWorktree #DevTools
Optimize Git Workflow with Worktrees for Developers
More Relevant Posts
-
Navigating software development often involves learning from errors, and many missteps are, in fact, recoverable. But what about mistakes in Git? 🤯 We're seeing a growing consensus that some Git blunders carry a far heavier price. A recent sharp observation in the developer community laid out why these aren't just 'mistakes';they're CRITICAL misjudgments. → Leaking confidential information: As one developer detailed, exposing API keys isn't a trivial error; it's a serious security breach. This isn't just about code; it's about data integrity and trust. → Unintended deployments: Pushing to `main` instead of `dev`? They pointed out this isn't a minor slip-up. It's triggering a potentially unprepared build, bypassing crucial testing stages, and risking production stability. → Lost historical context: When release history on platforms like GitHub is nonexistent, despite multiple production deployments, that developer noted it makes tracking changes and debugging a NIGHTMARE, exponentially increasing future workload. WHY THIS MATTERS SO MUCH The convenience of modern CI/CD pipelines and easy Git operations removes friction from shipping code. But that very convenience also strips away any excuse for sloppiness. The industry is moving faster, and robust Git practices are no longer optional. They are FOUNDATIONAL to security, stability, and efficient collaboration. We need to keep building, keep shipping, but always prioritize QUALITY over chaos. #SoftwareEngineering #Git #DevOps #CI_CD #TechInsights #Security
To view or add a comment, sign in
-
🚫 Stop Writing “git commit -m 'fixed stuff'” It is Friday at 4:30 PM. A critical bug just broke production. You open the terminal to see what changed today, and the Git history looks like this: "wip" "updates" "fixed bug" "finally working please God" When your Git history is a junk drawer of random thoughts, it is completely useless for debugging. You can't rollback safely because you have no idea what "updates" actually contains. The Fix: Conventional Commits. 🌳 Stop treating commit messages like a personal diary. Treat them like a professional changelog. Start every commit with a specific type, an optional scope, and a clear description: ✨ feat(checkout): add Stripe payment gateway 🐛 fix(auth): resolve JWT expiration bug ♻️ refactor(core): extract email logic to RabbitMQ Why this wins: ✅ Instantly Searchable: You can filter the log by fix or feat to find exactly what you need. ✅ Automated Changelogs: CI/CD tools can read these prefixes to automatically generate release notes. ✅ Easier Rollbacks: If a feature breaks, you know exactly which commit hash to revert. Write your commits for the developer who has to fix a production bug at 2 AM. (Because it will probably be you). What is the funniest/worst commit message you have ever seen in a real codebase? 👇 #Git #SoftwareEngineering #DeveloperCulture #CleanCode #WebDevelopment #Programming #DevOps
To view or add a comment, sign in
-
-
⚡️ Git Mistakes: Not Your Average Dev Oops Some mistakes in software development are understood. They happen, and people often get it. But there’s a growing, blunt truth emerging from the trenches: mistakes in Git are a DIFFERENT beast. A recent perspective forcefully articulated this point. They argue that while many development missteps might be forgiven, serious Git errors are not simple "mistakes." Leaking API keys? That's confidential information exposed. Pushing directly to main instead of dev? An unintended build triggered. No release history on GitHub for shipped products? Now debugging becomes a nightmare. This isn't just about individual oversight. CI/CD pipelines make deployment incredibly fast, and Git makes shipping easy. This powerful convenience strips away friction, but ; CRUCIALLY ; it also strips away excuses. We're observing a critical industry shift towards zero-tolerance for poor version control hygiene. With software supply chain security paramount, ensuring quality in our commits and branches is NON-NEGOTIABLE. Keep building. Keep shipping. But as the perspective concludes, let's collectively commit to shipping QUALITY, not chaos. #techinsights #softwareengineering #gitbestpractices #cicd #devops
To view or add a comment, sign in
-
Most developers know Git. Very few actually use it properly. Here are 15 Git mistakes developers STILL make in 2026 👇 1. Committing directly to main 2. Huge “final_final_v2” commits 3. Writing messages like “fix” 4. Force pushing blindly 5. Not pulling before push 6. Ignoring .gitignore 7. Rebasing without understanding it 8. Not reviewing diffs before commit 9. Merging without running tests 10. Using git reset randomly 11. Not tagging releases 12. Keeping dead branches forever 13. Leaving secrets in the repo 14. Ignoring Git hooks 15. Not learning reflog (your lifesaver) The scary part? Most production disasters don’t happen because of coding bugs. They happen because of bad Git practices. Senior engineers aren’t better because they code more. They’re better because they don’t break history. If you’ve made 5+ of these mistakes… You’re normal. If you’ve made 10+… It’s time to level up. 🔖 Save this before your next merge. 💬 Comment “GIT” if you want advanced Git workflows next. #Git #SoftwareEngineering #Developers #Programming #DevOps #TechCareers
To view or add a comment, sign in
-
-
Git doesn’t care how a commit is written. People do. Commit messages are how teams understand what changed, why it mattered, and how the system evolved over time. When they’re rushed or unclear, context gets lost fast. That loss shows up later during reviews, onboarding, audits, and debugging sessions. SmoothDev helps turn raw commit history into readable, human-friendly summaries without asking developers to slow down or rewrite anything. Because commits aren’t just technical markers. They’re communicating. #smoothdev #git #commitmessages #developers #softwareteams #documentation #devtools #developerexperience
To view or add a comment, sign in
-
-
Git doesn’t care how a commit is written. People do. Commit messages are how teams understand what changed, why it mattered, and how the system evolved over time. When they’re rushed or unclear, context gets lost fast. That loss shows up later during reviews, onboarding, audits, and debugging sessions. SmoothDev helps turn raw commit history into readable, human-friendly summaries without asking developers to slow down or rewrite anything. Because commits aren’t just technical markers. They’re communicating. #smoothdev #git #commitmessages #developers #softwareteams #documentation #devtools #developerexperience
To view or add a comment, sign in
-
-
Most developers can use Git. Fewer understand how it actually works internally. And that gap shows up the moment things go wrong: -> A bad git reset --hard -> A messy rebase -> Duplicate commits after rewriting history -> Lost work after a detached HEAD The turning point for me was this: Git is not a “change tracker.” It’s a content-addressable snapshot database backed by a Directed Acyclic Graph (DAG). Once you internalize that: -> A commit = snapshot + metadata + parent pointer -> A branch = mutable reference to a commit hash -> HEAD = pointer to a reference (or directly to a commit in detached mode) -> Rebase = replaying diffs to create new commits (new hashes) -> Reset = moving a branch reference -> Revert = creating inverse history without rewriting -> Reflog = reference movement journal (your real recovery tool) Git stops feeling magical. It becomes deterministic. I wrote a deep technical breakdown covering: -> How Git constructs the commit DAG -> Why rebasing changes commit identity -> What actually happens in soft vs mixed vs hard reset -> Why merge commits have two parents -> How conflicts arise from overlapping snapshots -> When history rewriting is safe vs dangerous -> How to recover “lost” commits using reflog If you care about clean history, safe collaboration, and understanding what your tooling is doing under the hood — this is for you. 🔗 Read the full guide here: https://lnkd.in/dYWjk3g9 For the engineers here — what’s your rule around rebase vs merge on shared branches? #git #distributedversioncontrol #softwareengineering #devops #backend #engineering
To view or add a comment, sign in
-
-
𝐆𝐢𝐭 𝐅𝐞𝐭𝐜𝐡 𝐯𝐬 𝐆𝐢𝐭 𝐏𝐮𝐥𝐥 — 𝐎𝐧𝐞 𝐒𝐦𝐚𝐥𝐥 𝐃𝐢𝐟𝐟𝐞𝐫𝐞𝐧𝐜𝐞, 𝐁𝐢𝐠 𝐈𝐦𝐩𝐚𝐜𝐭 A lot of Git confusion starts right here. Many developers assume 𝐠𝐢𝐭 𝐟𝐞𝐭𝐜𝐡 and 𝐠𝐢𝐭 𝐩𝐮𝐥𝐥 do the same thing. But They don’t — and that misunderstanding causes most Git-related issues in teams. When you run 𝐠𝐢𝐭 𝐟𝐞𝐭𝐜𝐡, Git only communicates with the remote repository. It downloads the latest commits and updates your local reference (origin/main). Your working code remains untouched. No files change. No conflicts. No surprises. Now comes 𝐠𝐢𝐭 𝐩𝐮𝐥𝐥. 𝐠𝐢𝐭 𝐩𝐮𝐥𝐥 goes a step further. It fetches the changes and immediately merges them into your current branch. 𝐓𝐡𝐚𝐭’𝐬 𝐰𝐡𝐲: • Files suddenly change • Merge conflicts appear • People feel Git is unpredictable In reality, Git is being precise — not random. The key line every engineer should remember: 𝐠𝐢𝐭 𝐩𝐮𝐥𝐥 = 𝐠𝐢𝐭 𝐟𝐞𝐭𝐜𝐡 + 𝐠𝐢𝐭 𝐦𝐞𝐫𝐠𝐞 𝐓𝐡𝐢𝐬 𝐢𝐬 𝐰𝐡𝐲 𝐦𝐚𝐧𝐲 𝐞𝐱𝐩𝐞𝐫𝐢𝐞𝐧𝐜𝐞𝐝 𝐞𝐧𝐠𝐢𝐧𝐞𝐞𝐫𝐬 𝐩𝐫𝐞𝐟𝐞𝐫 𝐭𝐨: • Run git fetch • Review the incoming changes • Merge only when they’re ready Same commands. Different level of control. Once this concept is clear, Git stops feeling confusing and starts feeling reliable. #Git #DevOps #SoftwareEngineering #VersionControl #Engineering #Tech
To view or add a comment, sign in
-
-
"</> Git Walk through: add and commit👩💻</>" Check the previous post: #GWT01 We all know that Sophie started her journey by cloning the working repository to her local system. She used: "git clone <repo-url>" This created a complete local copy of the repository along with the hidden .git folder. 👉 The .git folder is the actual local repository. Everything Git tracks — commits, branches, objects, logs — lives inside this folder. 📅 Day 1 – Observation Mode Sophie explored the existing codebase and understood the application flow. She also reviewed the branching strategy followed by the team: 🔹 main → Production 🔹 dev → Development 🔹 staging → Pre-production 🔹 qa → QA environment 🔹 <name>_<feature> → Feature branches Understanding the branching strategy is 🔑 before writing a single line of code. 📅 Day 2 – Time to Code 💻 By afternoon, Sophie completed her feature. Now she wants to save her work in the local repository. She used below commands. Step 1️⃣ "git add . " This moves files from the Working Directory → Staging Area (Index) Step 2️⃣ "git commit -m "Your commit message" " This saves the changes into the local repository (.git) as a snapshot. 🔍 What Happens Internally? (The Real Magic ✨) When she runs git add: ✅ Git creates Blob objects Blob = Binary Large Object, Stores raw file content Each blob gets a unique SHA-1 hash (40-character ID) When she runs git commit: ✅ Git creates: Tree object → Represents directory structure Commit object → Stores author, timestamp, message, and pointer to tree Also stores reference to the parent commit 📌 Important Correction: git add does NOT directly move files permanently — it updates the Index (Staging Area). Actual snapshot happens only during git commit. Now Sophie wants to double-check: ✔ Are all files staged correctly? ✔ Did the commit succeed? ✔ What branch is she on? What command should she use? 🤔 And after committing… what should be her next step? 👉 Should she push to remote? 👉 Should she rebase? 👉 Should she create a Pull Request? We’ll explore that in the next post of this Git journey series. Stay tuned 🚀 #post26 #GWT02 #Git #DevOps #VersionControl #GitInternals #LearningInPublic #SoftwareEngineering #Developers #TechJourney
To view or add a comment, sign in
-
-
Is your Git history a messy timeline of "oops" and "fixed typo again" commits? We've all been there: a feature takes 𝐚 𝐟𝐞𝐰 𝐡𝐨𝐮𝐫𝐬, but your `git log` looks like a novel. 😵💫 Before you push to that shared branch, make friends with `git rebase -i HEAD~N`. It's a game-changer! ⚡️ You can `squash` those trivial commits into logical chunks, `fixup` minor changes, or even `reword` commit messages to be more descriptive. Think of it as crafting a coherent narrative for your changes, not just a raw stream of consciousness. Your future self, and especially your code reviewer, will thank you for that beautifully concise commit like `feat: Add user profile page` instead of 10 micro-commits. A clean Git history isn't just aesthetic; it's a productivity superpower for easier reviews and debugging. What small change made a huge impact in your workflow? #DeveloperTips #CodingLife #FullStack
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