惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
V
V2EX
C
Check Point Blog
GbyAI
GbyAI
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
T
Troy Hunt's Blog
博客园 - Franky
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Security Blog
Microsoft Security Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学
The Cloudflare Blog
S
SegmentFault 最新的问题
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
I
InfoQ
博客园 - 【当耐特】
NISL@THU
NISL@THU
A
About on SuperTechFans
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Scott Helme
Scott Helme
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
Security Latest
Security Latest
V
Vulnerabilities – Threatpost
Security Archives - TechRepublic
Security Archives - TechRepublic
A
Arctic Wolf
Hacker News: Ask HN
Hacker News: Ask HN
N
News and Events Feed by Topic
IT之家
IT之家
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
SecWiki News
SecWiki News
大猫的无限游戏
大猫的无限游戏
S
Security Affairs
The Register - Security
The Register - Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LINUX DO - 热门话题
T
Tor Project blog

Nx Blog

Sharing Tailwind CSS Styles Across Apps in a Monorepo | Nx Blog How SiriusXM Stays Competitive by Iterating and Getting to Market Fast | Nx Blog Agentic Experience Is the New Developer Experience | Nx Blog Nx Joins the Linux Foundation and the Agentic AI Foundation | Nx Blog A Monorepo Is NOT a Monolith | Nx Blog Why we deleted (most of) our MCP tools | Nx Blog Teach Your AI Agent How to Work in a Monorepo | Nx Blog How Broadcom stays efficient and nimble with monorepos | Nx Blog Why Monorepos are King in the Age of AI | Nx Blog Nx 2026 Roadmap: Expanding Agent Autonomy, Improving Performance, Better Polyglot and More | Nx Blog End to End Autonomous AI Agent Workflows with Nx | Nx Blog Autonomous Agents at Scale | Nx Blog Scaling 700+ Projects: How Nx Became a 'No-Brainer' for Caseware | Nx Blog Configure Tailwind v4 with Angular in an Nx Monorepo | Nx Blog The Missing Multiplier for AI Agent Productivity | Nx Blog A Year of Nx Webinars | Nx Blog Wrapping Up 2025 | Nx Blog Nx 22.3 Release: Angular 21 Support, tsgo Compiler, and Prettier v3 | Nx Blog Nx Cloud Release: Agent Resource Usage | Nx Blog Nx Platform Outperforms DIY Cache by 5x | Nx Blog An Nx Carol: Past, Present, and Future of Your Monorepo | Nx Blog Nx 22.1 Release: Terminal UI on Windows, Storybook 10, Vitest 4, and more! | Nx Blog The Compounding Effect: How Nx Features Multiply Performance Gains | Nx Blog 10 Monorepo Myths Debunked: Separating Fact from Fiction | Nx Blog Nx Cloud Release: Enterprise Task Analytics | Nx Blog Watch and Rebuild Storybook Dependencies with Nx | Nx Blog Book - React for Enterprise: Timeless Architecture for Enterprise Apps | Nx Blog Beyond Remote Cache: Unlock 70% More CI Performance | Nx Blog Nx 22 Release: Expanding the build platform | Nx Blog What's the Point of Generating All This Code If You Can't Merge It? | Nx Blog What's New in Nx Self-Healing CI | Nx Blog Nx Highlights: Smarter AI integration, all-new graph UI, and big new versions of your favorite tools | Nx Blog Making the Case for Smarter Monorepos, and How to Not Get Fooled by Myths | Nx Blog Integrating Biome in 20 Minutes | Nx Blog S1ngularity - What Happened, How We Responded, What We Learned | Nx Blog Stop Babysitting Your PRs: Self-Healing CI Cuts Time to Green by 50% | Nx Blog UKG Unifies Their Codebase and Eliminates CI Overhead to Focus on Customer Value | Nx Blog Nx Cloud Workspace Graph: See Your Organization's Code Structure Like Never Before | Nx Blog Seamless Java Deployment in Nx Using Docker | Nx Blog Getting Mobile Into Your Monorepo: Android + Nx | Nx Blog Polyglot Projects Made Easy: Integrating Spring Boot into an Nx Workspace | Nx Blog The Journey of the Nx Plugin for Gradle: From Prototype to Production | Nx Blog Combining Predictability and Intelligence With Nx Generators and AI | Nx Blog A New UI For The Humble Terminal | Nx Blog Continuous tasks are a huge DX improvement | Nx Blog New and Improved Module Federation Experience with Nx | Nx Blog A New UI for Nx Migration | Nx Blog Custom Task Runners and Self-Hosted Caching Changes | Nx Blog Enterprise Angular Monorepo Patterns | Nx Blog Using Rspack with Angular | Nx Blog Angular Architecture Guide To Building Maintainable Applications at Scale | Nx Blog Modern Angular Testing with Nx | Nx Blog Nx Update: 20.5 | Nx Blog Are Monorepos the Answer to Better AI-Assisted Development? | Nx Blog Making Cursor Smarter with an MCP Server For Nx Monorepos | Nx Blog React Development for 2025 | Nx Blog Using Apollo GraphQL in an Nx Workspace | Nx Blog Angular State Management for 2025 | Nx Blog Tailoring Nx for Your Organization | Nx Blog Nx Cloud Pipelines Come To Nx Console | Nx Blog Define the relationship with monorepos | Nx Blog See your affected project graph in Nx Cloud | Nx Blog Handling CORS In Your Workspace | Nx Blog Improve your architecture and CI pipeline times with Nx projects | Nx Blog Announcing Nx 20 | Nx Blog Introducing Nx Powerpack | Nx Blog Nx 19.5 is here! Stackblitz, Bun, Incremental Builds for Vite, Gradle Test Atomizer | Nx Blog Introducing Explain with AI | Nx Blog Nx Enterprise Podcast Episode 2: Tine Kondo | Nx Blog Monorepos and CI can be a Mess - Here's How Nx and Nx Cloud Fixed It | Nx Blog Nx Enterprise Podcast Episode 1: Hicham El Hammouchi | Nx Blog Nx 19.0 Release!! | Nx Blog Manage Your Gradle Project using Nx | Nx Blog Making the Argument for Monorepos | Nx Blog Reliable CI. A new execution model fixing both flakiness and slowness | Nx Blog Monorepos - Why Speed Matters | Nx Blog Nx Agents Walkthrough: Effortlessly Fast CI Built for Monorepos | Nx Blog Launch Nx Week Recap | Nx Blog Versioning and Releasing Packages in a Monorepo | Nx Blog Fast, Effortless CI | Nx Blog Introducing @nx/nuxt Enhanced Nuxt.js Support in Nx | Nx Blog What if Nx Plugins Were More Like VSCode Extensions | Nx Blog Monorepos: the Benefits, Challenges, and Importance of Tooling Support | Nx Blog Nx — Highlights of 2023 | Nx Blog Nx 17.2 Update | Nx Blog Unit Testing Expo Apps With Jest | Nx Blog Nx Docs AI Assistant | Nx Blog State Management Nx React Native/Expo Apps with TanStack Query and Redux | Nx Blog Nx 17 has Landed | Nx Blog Nx Conf 2023 — Recap | Nx Blog Nx Raises $16M Series A | Nx Blog Introducing Playwright Support for Nx | Nx Blog Nx 16.8 Release!!! | Nx Blog Step-by-Step Guide to Creating an Expo Monorepo with Nx | Nx Blog Qwikify your Development with Nx | Nx Blog Create Your Own create-react-app CLI | Nx Blog Storybook Interaction Tests in Nx | Nx Blog Evergreen Tooling — More than Just CodeMods | Nx Blog Nx 16.5 Release!!! | Nx Blog A Practical Guide on Effective AI Use - AI as Your Peer Programmer | Nx Blog
How Git Worktrees Changed My AI Agent Workflow | Nx Blog
Juri Strumpflohner · 2025-08-08 · via Nx Blog

Do you know those times when you're working on something, but you also need to carry forward another feature on the side? Obviously, Git allows you to have branches for this specific purpose, but sometimes it's just easier to have a copy of the repo, have multiple instances of the editor open and switch back and forth. I've been doing this a lot, and even more so since AI agents became a daily tool in my development workflow.

Now guess what, Git has a dedicated feature for that: Git worktrees.

Already familiar with worktrees?

So what's the issue here?

It's tedious. You notice that PR that's failing on CI, meaning you need to switch back to that branch to fix it and re-trigger a run. The result:

  • you have to temporarily commit changes or stash whatever you've been currently working on
  • switch branches
  • potentially re-install node_modules (or whatever package manager you're using)

A lot of ceremony, which is annoying. Now, when it comes to failing PRs in CI, I've actually already got a solution for you: AI-Powered Self-Healing CI.

But if you want to work on multiple things locally, this will still be an issue.

Using AI agents made me find Git worktrees

And I'm pretty sure that's how you discovered it too. I'll leave it to you whether it's productive or not to have multiple things going on in parallel, but this has almost become the reality when you start incorporating AI agents into your development workflow.

Why do AI agents matter here? Here's a concrete use case:

  • You have an open issue on GitHub that should be rather straightforward to fix, so you plan to have it handled by an AI agent
  • You create a new branch issue-123 in a worktree ../nx-issue-123
  • You spin up Claude Code or your AI agent of choice, provide instructions and let it work on that branch.
  • Since this is in a worktree (i.e., a different folder), you can just switch back in your editor and continue working on what you were doing, while your AI agent keeps working in the background

Such scenarios are when you truly need multiple local copies of your repository. Branches wouldn't work here. Now, you could manually copy the repo, but that's clunky. Git worktrees provide a native way to handle exactly this use case.

Git worktrees 101

Git worktrees solve this elegantly by allowing multiple working directories from a single repository, each operating independently while sharing the same Git history.

Each worktree can be checked out to different branches, allowing true parallel development. A possible/common structure can be the following:

working-dir/
├─ nx/                       <<< main repo
├─ nx-feature-a/             <<< worktree for feature a
├─ nx-feature-b/             <<< worktree for feature b

I want to keep this short since you can look up all these commands with your LLM or Google them. But here are the main commands:

Creating a new worktree for a new branch "feature-a"

git worktree add ../nx-feature-a -b feature-a

This command:

  • Creates a new directory ../nx-feature-a
  • Checks out the feature-a branch in that directory
  • Links it to your main repository's Git history

If you already have an existing branch, just omit the -b.

List all worktrees

Remove a worktree

git worktree remove ../nx-feature-a

The beauty is that all worktrees share the same Git history. Changes committed in any worktree are immediately available to all others. You can merge between worktrees just like normal branches because they're all part of the same repository.

Hence you can merge a worktree just as you would normally do. Go back to your main repository and run:

(Note, most likely you're not merging directly anyway but rather going via some PR that merges into main)

Streamlining worktrees with the worktree CLI

While Git worktrees are powerful, I highly recommend checking out John Lindquist's worktree CLI, which streamlines some of the worktree management.

You can find out more on the corresponding GitHub repo, but here's the TL;DR:

npm install -g @johnlindquist/worktree@latest

This gives you the wt command with much simpler workflows:

You can now create new worktrees with

The tool automatically:

  • Generates standardized folder names ({reponame}-{branch-name})
  • Creates the worktree
  • Opens it in your configured editor

You can also list existing worktrees

Or open an existing worktree in your configured editor:

And remove a worktree when you're done:

Direct PR checkout

I particularly like this one. Similar to the GitHub CLI command gh pr checkout <pr-number> that I use all the time, there's a similar command in the Worktree CLI (in fact, it relies on the GitHub CLI underneath):

This checks out a given PR directly into its own worktree, which is really nice if you need to review it locally or just add some minor changes to it.

Wrapping up

This isn't just for AI workflows. Worktrees are valuable anytime you need to work on multiple branches simultaneously and want to quickly jump back and forth—like reviewing PRs or handling urgent fixes without losing your current context.

That's a wrap. Hopefully, with Git worktrees and Nx Cloud's self-healing CI, I was able to provide you with some neat additions to your developer toolbox.


Learn more: