In my circles, surprisingly few people use git worktree — even though it’s been one of the most useful workflow changes I’ve made when working with coding agents. I use a simple hub + spokes setup: one central repo as the hub, with each branch checked out into its own “spoke” directory. Instead of constantly switching branches and stashing, you check out each branch into its own directory. They share the same Git history, but each has its own clean working copy. That means you can run a separate agent in each — one on an auth refactor, another on a new endpoint, a third writing tests — all in parallel, without collisions. Your main checkout stays untouched. A few things that surprised me: • In my experience, agents produce better output starting from a clean state • When one goes sideways, I just remove the worktree (after pushing anything useful) and start over • Same branch point, two worktrees, two agents — diff the results, keep the better one I wrote up the full workflow here: https://lnkd.in/dDD6V6w5 I’m curious: how are you handling parallel development with agents today? Do you use worktrees, separate clones, or something else? Feel free to share in the comments. #AIEngineering #AIAssistedDevelopment #EngineeringWorkflows
Péter István Fülöp’s Post
More Relevant Posts
-
🔹 Git Worktree — One Repository, Multiple Working Directories Most developers don’t realize this: You can work on multiple branches at the same time without cloning the repository again. That’s exactly what Git Worktree enables. 🧠 The Problem Developers Face Imagine this situation: You are working on a feature branch. Suddenly a production bug appears. Normally you would: • stash changes • checkout another branch • fix bug • come back and restore work It becomes messy and slow. 🚀 Enter Git Worktree Git Worktree lets you attach multiple working folders to the same repository. Each folder can checkout different branches simultaneously. Think of it like: 🏠 One house (Git repository) 🚪 Multiple rooms (worktrees) 👨💻 Each room doing different work. No extra clones. No branch switching chaos. ⚙️ How It Works Example: git worktree add ../feature-login feature-login What happens: • Creates a new folder feature-login • Checks out the branch feature-login there • Both folders share the same .git history Now you can: 📂 Folder 1 → main branch 📂 Folder 2 → feature-login branch Both active at the same time. 🔥 Real Developer Use Cases 💡 Hotfix while feature development continues Fix production bug in another folder while feature code remains untouched. 💡 Parallel development Work on multiple features simultaneously. 💡 Clean testing environments Run experiments without disturbing your main working directory. 💡 Review branches quickly Checkout PR branches instantly. 📌 Key Commands Create worktree git worktree add ../new-folder branch-name List worktrees git worktree list Remove worktree git worktree remove ../new-folder 🧠 The Big Insight Most developers clone repositories repeatedly. But Git already solved this problem. Git Worktree turns one repository into a multi-workspace development environment. Faster workflows. Cleaner context switching. Less chaos. 💬 Curious to know: How do you usually handle switching between multiple Git branches? #Git #GitWorktree #SoftwareDevelopment #DeveloperProductivity #DevTools #ProgrammingTips #Engineering #CodingLife #TechLearning #BuildInPublic
To view or add a comment, sign in
-
Two developers. One shared branch. No fear. Full confidence. 😌 Developer 1 spends hours writing clean, beautiful, “production-ready” code. Tests ✅. Build ✅. Pushes happily: git push 🚀 Life is good. He feels like a 10x engineer. Then Developer 2 jumps into the same branch. Makes some changes. Maybe a “small improvement.” Maybe a “tiny refactor.” Everything works locally (of course it does 😏). Pushes: git push ✅ Still peaceful. But then… he remembers: “Oh… I rebased.” 🤔 Instead of messaging the team. Instead of checking carefully. He confidently types: git push --force 💀 And just like that… ✨ Commits vanish ✨ History rewritten ✨ Developer 1 refreshing GitHub like: “Where is my code???” 😭 ✨ Slack message appears: “Who force pushed?” 👀 Suddenly everyone is offline. Moral of the story: Git is powerful. --force is more powerful. But communication is the most powerful. 😅 Two developers. One branch. Zero coordination. What could possibly go wrong? 🚨 #Git #DeveloperLife #CodingHumor #SoftwareEngineering #ProgrammerLife #revnix
To view or add a comment, sign in
-
🚀 A small Git trick that improved my development workflow While working on my backend project, I faced a common problem many developers experience — working on multiple things at the same time. Normally, when we switch between tasks, we keep changing Git branches in the same folder. But doing this repeatedly can interrupt the workflow, especially if the server is already running or you want to test different things simultaneously. While exploring solutions, I discovered Git Worktree, and it completely changed how I manage parallel work. Instead of switching branches in the same folder, I created separate workspaces for each branch. Each workspace opens in its own VS Code window and works independently. Now my setup looks like this: • Workspace 1 → branch A • Workspace 2 → branch B This simple approach allows me to: ✅ Work on multiple tasks in parallel ✅ Avoid constantly switching branches ✅ Keep development context clean ✅ Run multiple instances of the project if needed The command that made this possible: git worktree add <folder-name> -b <branch-name> 💡 Tip: If you are using AI coding agents, this setup also lets you run parallel agents in separate workspaces, each with its own context. It makes multitasking much smoother 🙂 Sometimes small workflow discoveries like this can significantly improve productivity. Still learning, experimenting, and improving my development process every day 🚀 #SoftwareDevelopment #Git #DeveloperWorkflow #BackendDevelopment #LearningInPublic
To view or add a comment, sign in
-
💻 Every developer knows this moment.... You run a Git command confidently.... Everything looks fine.... Then suddenly your terminal, commits, or branch history looks completely wrong and the only thing that comes to mind is: “Ohhh Shit.... what did I just do to my repository?” 😅 If you've worked with Git long enough, you’ve probably experienced things like: • committing to the wrong branch • accidentally resetting commits • messing up a merge • or wondering where your lost commits disappeared While exploring some Git resources recently, I came across a very interesting and surprisingly helpful website: 🔗 https://ohshitgit.com/ It’s basically a Git survival guide for developers. What makes it different from typical Git documentation is that it focuses on real-life panic situations developers face and provides quick commands to fix them. Here are a few examples from the site 👇 🔹 Committed to the wrong branch? git branch new-branch git reset HEAD~ --hard git checkout new-branch 🔹 Forgot to add something to your last commit? git add . git commit --amend --no-edit 🔹 Need to safely undo a commit? git revert <commit-hash> 🔹 Lost commits and need to recover them? git reflog Fun fact: "git reflog" is basically Git’s hidden time machine that can save you when everything feels broken. What I personally liked about this resource is that it skips the long theoretical explanations and instead focuses on practical developer problems that happen during daily work. Working at Zignuts Technolab, where Git plays a crucial role in collaboration and version control, resources like this can be extremely useful when things go sideways during development. Definitely a site worth bookmarking for every developer. Now I’m curious 👀 What’s the most “Ohhh Shit” Git moment you’ve ever had? #Git #Developers #Programming #SoftwareDevelopment #WebDevelopment
To view or add a comment, sign in
-
-
🚀 Every developer faces this Git moment… You start your day, open your project, and think: “Let me get the latest code from the repository.” But then comes the question in Git: 🤔 Should I use "git fetch" or "git pull"? Let’s understand with a simple situation. 👨💻 Developer 1 – The Careful One Runs: 🔹 git fetch ✔ Downloads the latest changes from the remote repo. ✔ Reviews changes first before touching your code. His thinking: “Let me see what others changed before merging.” Command: git fetch origin --- 🔥 Developer 2 – The Brave One Runs: 🔹 git pull ✔ Downloads changes ✔ Automatically merges them into your branch. His thinking: “YOLO. Let’s update everything into my code now!" Command: git pull origin main --- 💡 The real difference "git fetch" → Download changes safely "git pull" → Download + merge instantly 📌 Pro Tip: Many experienced developers prefer fetch first, then merge manually to avoid surprises. #Git #SoftwareDevelopment #Developers #Programming #VersionControl
To view or add a comment, sign in
-
-
Git Merge vs Git Rebase — Which One Should You Use? Ever been in a Git tug-of-war between merge and rebase? Let’s break it down with a real-world analogy: Imagine two friends taking different routes to the same destination. - Merge is like meeting at the destination and saying, “Let’s combine our journeys into one story.” - Rebase is like rewriting your journey to make it look like you both took the same path all along. ✅ Use merge when: You're working in a team and want to preserve the true history of changes. You’re merging a feature branch into main and want to show the full context. ✅ Use rebase when: You want a clean, linear history (especially before merging a feature branch). You’re working solo or rebasing local commits before pushing. 🧪 Quick Examples: # Merge feature into main (creates a merge commit) git checkout main git merge feature-branch # Rebase feature onto main (rewrites history) git checkout feature-branch git rebase main Pro Tip: Never rebase shared branches. It rewrites history and can cause conflicts for your teammates. Mentors: Sheryians Coding School Ankur Prajapati MOHD ALI ANSARI Sarthak Sharma Satwik Raj Harsh Vandana Sharma #15of21DayDevChallenge #21DayDevChallenge #Git #GitTips #WebDevelopment #SoftwareEngineering #DevLife #GitMerge #GitRebase #CleanCode #VersionControl #DeveloperTips #CodeSmarter #AspiringDevelopers
To view or add a comment, sign in
-
-
90% of developers use Git daily, but only 10% actually understand it. You don’t need to know 100 commands; you need the right 20–30 that truly matter. Here’s the Git cheat sheet I wish someone had given me earlier. The Everyday Commands (You use these 80% of the time): - git status – What did I just break? - git add . – Stage everything - git commit -m "message" – Save your progress - git diff – What exactly changed? - git log --oneline – Clean commit history Branch Like a Pro: - git checkout -b feature/login – Create new branch - git branch – List branches - git merge branch_name – Merge code - git branch -D branch_name – Delete branch Working With Remote: - git clone repo_url – Get the code - git push origin branch – Send your work - git pull – Get latest updates - git fetch – Check updates safely Level Up Commands (Most devs avoid these): - git rebase -i – Clean messy commit history - git commit --amend – Fix last commit - git cherry-pick commit_id – Copy one commit - git stash / git stash pop – Pause work temporarily When Things Go Wrong (And they will): - git reset --soft HEAD^ – Undo commit safely - git reset --hard – Nuclear option - git revert commit_id – Undo without rewriting history Real power move? If you deeply understand reset, rebase, and cherry-pick, you’re already ahead of most developers. Save this post for later. Share it with a teammate who still fears Git. Which Git command do you use the most ? #Git #SoftwareEngineering #Developers #Coding #Programming #TechCareers #FullStack
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
-
-
🚀 Git becomes much easier when you stop memorizing commands and start understanding the flow A lot of developers learn Git like a list of random commands: git add git commit git push git pull git stash But Git makes far more sense when you see it as a workflow between 4 spaces: 1) Working Directory Where your actual file changes happen. 2) Staging Area Where you prepare exactly what you want to commit. 3) Local Repository Your local history of commits on your machine. 4) Remote Repository The shared version of the project used by your team. The core Git flow ✅ git add Moves changes from the working directory to the staging area. ✅ git commit Saves staged changes into your local repository history. ✅ git push Sends your local commits to the remote repository. That’s the basic publishing loop. Getting changes from others ✅ git clone Copies a remote repository to your machine. ✅ git fetch Gets new changes from remote without merging them into your working branch. ✅ git pull Fetches and merges remote changes into your current branch. ✅ git merge Combines changes from one branch into another. Useful “save me” commands ✅ git reset Used to undo staged or committed changes, depending on how you use it. ✅ git stash Temporarily saves uncommitted changes so you can switch context. ✅ git stash apply / git stash pop Brings those saved changes back when you’re ready. The real takeaway Git is not just a tool for saving code. It is a state management system for your work. Once you understand: where your code is what state it’s in and where each command moves it …Git stops feeling confusing. It starts feeling predictable. 💬 Quick question: Which Git command caused you the most confusion when you were learning? rebase, reset, stash, or pull? #Git #GitHub #VersionControl #SoftwareEngineering #DeveloperTools #Programming #Coding #DevOps #Tech #LearningToCode
To view or add a comment, sign in
-
-
🚀 Git: The Backbone of Modern Software Development In the fast-paced world of coding, Git isn’t just a tool—it’s your version control superpower. Whether you’re a solo dev or part of a massive team, Git keeps your code safe, collaborative, and sane. Here are 5 reasons why every developer needs Git mastery: • Branching Magic: Experiment fearlessly with `git branch` and `git checkout`—no more “breaking the main codebase”! • Conflict Crusader: Merge branches smoothly with `git merge` or `git rebase` to resolve those pesky conflicts. • History Detective: Dive into commits with `git log` and `git blame` to track who changed what, when. • Remote Hero: Push/pull from GitHub/GitLab with `git push/pull` for seamless team sync. • Undo Button: `git reset` and `git revert` let you time-travel without regrets. Pro Tip: Start with `git init` on your next project and level up to GitHub Actions for CI/CD automation. What’s your go-to Git command or workflow hack? Drop it in the comments! 👇 #Git #VersionControl #DevOps #SoftwareDevelopment #CodingTips
To view or add a comment, sign in
-
More from this author
Explore related topics
- How to Use AI Agents to Optimize Code
- Tips for Improving Developer Workflows
- How to Use AI Agents in Model-Centric Workflows
- How to Boost Productivity With Developer Agents
- How to Use Agentic AI in Business Workflows
- How to Use AI Agents to Streamline Digital Workflows
- How to Use Agent Mode to Automate Workflows
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