Context switching is the #1 thief of your time 🕵️♂️💸 You’re mid-feature when a critical production bug hits. Your options? 1. git stash (and hope you remember what you were doing). 2. git clone a second copy (and waste 10 minutes setting it up). 3. Use Worktrees. Architecture-wise, Worktrees are the most underutilized power feature in Git. They allow you to have multiple branches checked out simultaneously in different folders, all linked to the same local database. In SmartGit 26.1.x, we’ve made managing these "parallel universes" effortless: ✅ Visual States: The Branches view and Graph now indicate if a worktree is "clean" or "modified." You can see exactly where your "work-in-progress" is living without leaving your main view. ✅ Submodule Mastery: We’ve added a full suite of Submodule commands (Add, Reset, Deinit, Unregister) directly to the Standard window. No more manual CLI wrestling with nested repos. ✅ Strategic Fetching: A new repository option allows you to "fetch current" instead of "fetch all." In massive, modular architectures, this is the difference between a 2-second refresh and a 2-minute wait. As systems become more distributed and modular, your local workflow needs to be just as decoupled. Are you a "one branch at a time" developer, or have you discovered the freedom of a Worktree workflow yet? 👇 #Git #Worktrees #Submodules #SmartGit #smartgit #DevOps #ProductivityHacks
Boost Git Productivity with Worktrees
More Relevant Posts
-
𝐄𝐯𝐞𝐫 𝐡𝐚𝐝 𝐆𝐢𝐭𝐇𝐮𝐛 𝐣𝐮𝐬𝐭... 𝐭𝐚𝐤𝐞 𝐚 𝐜𝐨𝐟𝐟𝐞𝐞 𝐛𝐫𝐞𝐚𝐤? ☕️ We’ve all been there. You’ve rebased, updated your baselines, and pushed the final fixes for a feature. You’re ready to merge and move on to the next task, but then you hit the dreaded: "Checking for the ability to merge automatically..." 🔄 It’s been hanging for a while now. Sometimes the simplest part of the CI/CD pipeline becomes the biggest test of patience. When the UI gets stuck in a loop, I’ve found that the most reliable way to move forward is to bypass the browser and handle the merge directly in the terminal. If you’re facing this, here is the generalised workflow to force the issue: 1️⃣ Sync your local environment: 𝐠𝐢𝐭 𝐟𝐞𝐭𝐜𝐡 𝐨𝐫𝐢𝐠𝐢𝐧 2️⃣ Move to your target branch (e.g., your release or main branch): 𝐠𝐢𝐭 𝐜𝐡𝐞𝐜𝐤𝐨𝐮𝐭 [𝐭𝐚𝐫𝐠𝐞𝐭-𝐛𝐫𝐚𝐧𝐜𝐡] 𝐠𝐢𝐭 𝐩𝐮𝐥𝐥 𝐨𝐫𝐢𝐠𝐢𝐧 [𝐭𝐚𝐫𝐠𝐞𝐭-𝐛𝐫𝐚𝐧𝐜𝐡] 3️⃣ Merge the remote feature branch directly: 𝐠𝐢𝐭 𝐦𝐞𝐫𝐠𝐞 𝐨𝐫𝐢𝐠𝐢𝐧/[𝐟𝐞𝐚𝐭𝐮𝐫𝐞-𝐛𝐫𝐚𝐧𝐜𝐡-𝐧𝐚𝐦𝐞] 4️⃣ Push the results to finalize the PR: 𝐠𝐢𝐭 𝐩𝐮𝐬𝐡 𝐨𝐫𝐢𝐠𝐢𝐧 [𝐭𝐚𝐫𝐠𝐞𝐭-𝐛𝐫𝐚𝐧𝐜𝐡] While the "Update branch" button is convenient, there’s a certain peace of mind that comes with seeing the merge happen in real-time in your CLI. 💻 Has anyone else encountered this persistent "checking" state on GitHub lately? Do you prefer waiting it out, or are you a "straight to the terminal" kind of developer? Drop your favorite Git "rescue" commands in the comments! 👇 #GitHub #WebDevelopment #SoftwareEngineering #GitTips #CodingLife #ProblemSolving #DevOps
To view or add a comment, sign in
-
36 Git Commands Every Developer Must Know (Save This!) I've seen developers waste hours doing manually what Git can do in seconds. Not because they weren't smart — but because nobody gave them a proper reference. So here it is. Everything you need: 1) Setup & Config — get Git ready on any machine. 2) Staging & Commits — save your work the right way. 3) Status & History — always know what changed and when. 5) Branching — work in isolation, merge with confidence. 6) Merge & Rebase — clean, linear history every time. 7) Remote Operations — push, pull, fetch like a pro. 8) Stash — context-switch without losing your work. 9) Undo & Reset — fix mistakes before they become disasters. 10) Tags & Releases — version your software professionally. Daily Workflow That Actually Works: git pull → create branch → commit often → push → open PR → merge 3 Rules That Will Save You: → Commit small and often. Big commits are hard to debug. → Write commit messages in present tense: "Fix bug" not "Fixed bug" → NEVER force push to main. Your teammates will thank you. Git isn't just a tool — it's a communication system for your team. The better you use it, the better your team collaborates. 📌 Save this post. You'll need it. 🔔 Follow for more developer tools, tips & resources every week. Which Git command took you the longest to understand? Drop it below 👇 #Git #VersionControl #Programming #OpenSource #DevTools #CodingTips #GitHub #BackendDevelopment #LearnToCode #SoftwareEngineering #PythonDeveloper
To view or add a comment, sign in
-
-
This morning I said I prefer merge. This afternoon I'm going to tell you why. 🔥 I once rebased a feature branch onto main and hit a conflict on every single replayed commit. The same file, over and over, because the rebase was replaying each commit individually against a main that had diverged significantly. By the fifth resolution I wasn't even reading the diff anymore. I was just picking sides and hoping. That's not engineering. That's gambling with your codebase. I aborted, ran git reflog to confirm I could recover, and did a merge instead. One conflict. One resolution. Done. Git Recovery Cheat Sheet: ✔️ Mid-Rebase Escape: git rebase --abort (returns your branch to the exact state before the rebase started) ✔️ Already Finished a Bad Rebase: git reflog then git reset --hard HEAD@{n} (find the pre-rebase entry in reflog and reset to it) ✔️ Undo a Merge (Before Pushing): git reset --hard HEAD~1 (removes the merge commit, only safe if you haven't pushed) ✔️ Undo a Merge (Already Pushed): git revert -m 1 <merge_commit_hash> (creates a reversal commit, safe for shared branches) ⚠️ git reset --hard is destructive. It discards uncommitted work. Run git stash first if you have unsaved changes. Never use it on a branch others have pulled. 🔍 Before you run any destructive Git command, run git reflog first. Confirm you can see where you were. That's your safety net. 💾 Save this. You won't need it until you do, and when you do, you'll need it fast. #Git #GitOps #DevOps #DamnitRay
To view or add a comment, sign in
-
Stop using git stash as a workflow. Here's what happens every time: git stash push -m "wip feature" git switch main # fix the bug, commit, push git switch feature/x git stash pop # CONFLICT in src/auth.ts You lose 15–20 minutes of flow state. Your node_modules are now wrong. Your dev server crashed. And if you stacked multiple stashes? Good luck remembering which one is which. The fix has been in Git since version 2.5 (2015): git worktree add ../hotfix main That's it. You now have a second directory — same repo, separate branch. Your feature branch stays open with your dev server running. Walk over to the hotfix directory, fix the bug, push, walk back. No stashing. No conflicts on pop. No rebuilding dependencies. Each worktree gets its own working tree, staging area, and HEAD pointer. They share the same .git object database — so there's no re-cloning, no extra fetch. One `git fetch` updates all worktrees. Real-world use cases I reach for daily: — Run tests on `main` while coding on `feature/x` — Review a PR in its own directory with a fresh dev server — Compare two implementations side by side in separate editor windows When this doesn't apply: — Quick 2-minute fixes where `git stash` is genuinely faster — Repos with expensive build artifacts that would duplicate across worktrees — If your team squashes everything to `main` and you rarely context-switch Nx and pnpm both documented worktree-based workflows in 2025 — especially for running parallel AI coding agents, where each agent needs its own isolated checkout to avoid file conflicts. When you're done: `git worktree remove ../hotfix`. Clean, no leftover directories. How many stashes do you have right now? Run `git stash list` — I bet it's more than zero. #Git #DeveloperProductivity #WebDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
𝗜 𝘁𝗵𝗼𝘂𝗴𝗵𝘁 𝗜 𝗸𝗻𝗲𝘄 𝗚𝗶𝘁... 𝘂𝗻𝘁𝗶𝗹 𝗜 𝗵𝗮𝗱 𝘁𝗼 𝗱𝗼 𝘁𝗵𝗶𝘀. Recently I ran into a pretty unusual scenario: • move an entire sprint between different repositories • keep the commit history intact • adapt commit message conventions along the way But there was a real constraint: 𝘁𝗵𝗲 𝗽𝗿𝗼𝗷𝗲𝗰𝘁𝘀 𝗵𝗮𝗱 𝗱𝗶𝗳𝗳𝗲𝗿𝗲𝗻𝘁 𝗶𝗻𝗳𝗿𝗮𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲 (𝘀𝗲𝗿𝘃𝗲𝗿 𝗰𝗼𝗻𝗳𝗶𝗴𝘀, 𝗗𝗼𝗰𝗸𝗲𝗿, 𝗽𝗶𝗽𝗲𝗹𝗶𝗻𝗲𝘀...) So copying code wasn’t an option. That’s when I used a lesser-known approach: 𝗽𝗮𝘁𝗰𝗵𝗲𝘀 + 𝘄𝗼𝗿𝗸𝘁𝗿𝗲𝗲𝘀 𝘁𝗼 𝗺𝗼𝘃𝗲 𝗱𝗲𝘃𝗲𝗹𝗼𝗽𝗺𝗲𝗻𝘁 𝗮𝗰𝗿𝗼𝘀𝘀 𝗰𝗼𝗻𝘁𝗲𝘅𝘁𝘀 The flow looked like this: 1. Develop normally in a worktree 2. Export commits using `git format-patch` 3. Adjust the patches 4. 𝗥𝗲𝗺𝗼𝘃𝗲 𝗰𝗼𝗺𝗺𝗶𝘁𝘀 𝘁𝗵𝗮𝘁 𝗱𝗶𝗱𝗻’𝘁 𝗯𝗲𝗹𝗼𝗻𝗴 𝗶𝗻 𝘁𝗵𝗲 𝘁𝗮𝗿𝗴𝗲𝘁 (𝗲.𝗴. 𝗶𝗻𝗳𝗿𝗮 𝗰𝗼𝗻𝗳𝗶𝗴𝘀) 5. Prepare the correct base on the destination 6. Reapply everything with `git am --3way` Sounds simple… but then reality hit: - commit conventions were different between the projects So I did what any dev would do… 𝗜 𝗮𝘂𝘁𝗼𝗺𝗮𝘁𝗲𝗱 𝗶𝘁 I built a shell script that: • reads a YAML mapping file (from → to) • renames patches automatically • asks for input when no mapping is found • allows 𝘀𝗸𝗶𝗽 or even 𝗮𝗯𝗼𝗿𝘁 𝗮𝗹𝗹 mid-process Result: - repeatable process - fewer manual errors - full control over history And that’s when it clicked: Git is not just version control it’s a tool for 𝘁𝗿𝗮𝗻𝘀𝗳𝗼𝗿𝗺𝗶𝗻𝗴 𝗮𝗻𝗱 𝘁𝗿𝗮𝗻𝘀𝗽𝗼𝗿𝘁𝗶𝗻𝗴 𝗵𝗶𝘀𝘁𝗼𝗿𝘆 You don’t need to copy code. You can 𝗿𝗲𝗯𝘂𝗶𝗹𝗱 𝘁𝗵𝗲 𝘀𝘁𝗼𝗿𝘆 𝘁𝗵𝗲 𝗿𝗶𝗴𝗵𝘁 𝘄𝗮𝘆 𝗼𝗻 𝘁𝗵𝗲 𝗼𝘁𝗵𝗲𝗿 𝘀𝗶𝗱𝗲. And that opens up a whole new set of possibilities. Curious: - have you ever automated a “weird” Git workflow like this? #git #softwareengineering #backend #devlife #programming #developer #tech #coding #automation #devops #softwaredevelopment #engineering
To view or add a comment, sign in
-
-
Most people use Git. Very few understand why it’s so efficient. Here’s the short explanation 👇 🧠 Git = content-based system It doesn’t store files. It stores snapshots (via hashes) Same content? → Stored once. No duplication.(deduplication) ⚙️ What happens in a commit? git commit -m "update" Behind the scenes: • Blob → file content • Tree → folder structure • Commit → snapshot + metadata Everything linked with hashes 🔗 📦 Why Git stays fast • Packfiles → bundle objects • Delta compression → store only changes Change 1 line? Git stores just that. Not the whole file. !! Without this the repose just explode !! 🔧 Hidden layer (most ignore) • Porcelain → git add, git push • Plumbing → actual engine Try this once 👇 echo "hello" | git hash-object -w --stdin You just created a Git object manually. If you understand internals → branching, rebasing, debugging becomes easy. 💡 Insight Git isn’t storing history… It’s storing connected snapshots 📚 Quick refs: https://lnkd.in/gSeM2kmA https://lnkd.in/gEMefujR Git becomes powerful the moment you stop memorizing… and start understanding ⚡ 👉 What part of Git still feels confusing to you? #Git #DevOps #Engineering #Backend — Abhishek Singh Chauhan
To view or add a comment, sign in
-
-
When Git finally makes sense, everything in your development workflow starts feeling easier. A lot of people find GitHub confusing at first, but once you understand the basics, everything becomes much more organized. 𝗛𝗲𝗿𝗲’𝘀 𝘁𝗵𝗲 𝘀𝗶𝗺𝗽𝗹𝗲𝘀𝘁 𝘄𝗮𝘆 𝘁𝗼 𝘁𝗵𝗶𝗻𝗸 𝗮𝗯𝗼𝘂𝘁 𝗶𝘁: - Repository → your project workspace - Commit → a saved snapshot of your progress - Branch → a safe parallel version for testing changes - Merge → combining updates from different branches - Push / Pull → syncing local and remote code 𝗚𝗶𝘁 𝗰𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗲𝘃𝗲𝗿𝘆 𝗯𝗲𝗴𝗶𝗻𝗻𝗲𝗿 𝘀𝗵𝗼𝘂𝗹𝗱 𝗸𝗻𝗼𝘄 - "git init" → create a new repository - "git clone <url>" → copy an existing repo to your system - "git status" → check modified files - "git add ." → stage all changes - "git commit -m "message"" → save your work with a note - "git push" → upload local changes - "git pull" → fetch the latest updates - "git branch" → view available branches - "git checkout -b dev" → create and switch to a new branch - "git merge dev" → merge branch changes 𝗣𝗿𝗮𝗰𝘁𝗶𝗰𝗮𝗹 𝗚𝗶𝘁 𝗵𝗮𝗯𝗶𝘁𝘀 𝘁𝗵𝗮𝘁 𝘀𝗮𝘃𝗲 𝘁𝗶𝗺𝗲 - Don’t run commands blindly—understand what each one does - Avoid working directly on "main"; use branches - Keep commit messages clear and meaningful - Always run "git status" before committing - Pull latest changes before pushing your code Small Git habits like these can save hours of debugging and confusion later. If this made Git simpler for you, repost it so it can help another developer too. #Java #JavaDevelopers #Software #SoftwareEngineers #Hiring
To view or add a comment, sign in
-
Stop Manual Deployments! 🚀 If you are still manually dragging files to a server or running git pull on your production machine, this post is for you. As a Full Stack Developer, building the app is only half the battle. The real magic happens when you automate the journey from your local machine to the live user. Here is a breakdown of the modern CI/CD Pipeline I use to ensure my code is bug-free and always live: Phase 1: Continuous Integration (The Safety Net) 🛡️ Git Push: Every commit triggers a pipeline. Automated Testing: Running Unit Tests (Jest/Mocha) and Linting (ESLint). If it's broken, it doesn't move forward. Phase 2: Build & Package (The Engine) 📦 Frontend Optimization: Minifying JS/CSS for faster load times. Dockerization: Packaging the app into containers so it runs exactly the same on any server. Phase 3: Continuous Deployment (The Launch) 🚀 Staging: Deploying to a "hidden" environment for final QA. Production: Automated rollout with zero downtime (Blue-Green or Rolling updates). Phase 4: Monitoring (The Feedback Loop) 📈 Tracking errors in real-time with tools like Sentry or Datadog to fix issues before users even notice them. The Result? Faster shipping, fewer bugs, and more sleep at night. 😴 What’s your favorite CI/CD tool? 🛠️ I’m currently leaning towards GitHub Actions, but I’d love to hear if you prefer Jenkins, GitLab CI, or something else! Let’s discuss in the comments. 👇 #FullStackDeveloper #DevOps #CICD #SoftwareEngineering #WebDevelopment #Programming #CodingLife #GitHubActions #Docker
To view or add a comment, sign in
-
-
Git Fetch vs Git Pull: The Difference That Can Save Your Codebase Most developers start using git pull without thinking twice. It works... until it does not. If you have ever faced unexpected conflicts or messy commits, this might be why. Lets break it down in a simple way: - git fetch This command downloads changes from the remote repository But does NOT apply them to your current branch Think of it as: Let me see what changed before I touch anything. What makes it powerful: - Safe and non-destructive - Lets you review changes before merging - Perfect for team environments Typical workflow: - git fetch - git diff - git merge - git pull This command is basically: - git fetch + git merge It downloads AND applies changes automatically Think of it as: Just update everything now. What makes it convenient: - Faster workflow - Less manual steps - Great for quick updates But here is the catch: - You lose visibility - Merges happen automatically - Conflicts can appear unexpectedly Real-world tip: In teams, git fetch is your best friend. It gives you control and avoids surprises. Simple rule to remember: - git fetch = download and review - git pull = download and merge instantly If you care about clean history and fewer headaches, control always wins over speed. What is your default: fetch or pull? #git #softwareengineering #programming #developer #devops #coding #backend #webdevelopment #tech #engineering #versioncontrol #computerscience #careergrowth
To view or add a comment, sign in
-
-
Stop the "Stash & Switch" madness. 🛑 We’ve all been there: You’re deep in a feature, your workspace is a mess of half-finished logic, and suddenly... a critical bug hits production. Most devs reach for git stash. Some make a messy "WIP" commit. But there’s a better way that most people ignore: Git Worktree. Instead of flipping a single folder between branches, Git Worktree lets you "check out" multiple branches into separate folders simultaneously, all linked to the same local repo. Why is this a game-changer? ✅ Zero Context Switching: Keep your feature code open in one VS Code window and your hotfix in another. No stashing required. ✅ Parallel Testing: Run a heavy test suite or build process on one branch while you keep coding on the other. ✅ Code Reviews: Need to test a teammate's PR? Open it in a new worktree without touching your current progress. ✅ No More npm install Loops: If branches have different dependencies, worktrees keep their respective node_modules intact. No more re-installing every time you switch. The Magic Command: git worktree add ../hotfix-folder hotfix-branch It’s one of those "once you know it, you can't go back" tools. Are you still stashing, or have you made the switch to Worktrees? Let’s hear your workflow hacks in the comments! 👇 #Git #WebDevelopment #SoftwareEngineering #DevOps #ProgrammingTips #Efficiency
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