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

推荐订阅源

小众软件
小众软件
博客园 - Franky
罗磊的独立博客
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
V
V2EX
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
U
Unit 42
GbyAI
GbyAI
A
About on SuperTechFans
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
D
DataBreaches.Net
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap
GitHub - allisonmahmood/NT: nt — git worktree quick-switc...
Allisonmahmo · 2026-06-26 · via Show HN

nt — navigate tree

Git worktrees, minus the ceremony. nt (short for navigate tree) is a tiny zsh command for hopping around worktrees: it spins one up — or jumps to it if it already exists — cds you in, and gets out of your way.

nt fix-login   # worktree up, cd'd in, go

Honestly? You should just ask your agent to build this for you — it's a 20-minute job. But if you're too scared to let it loose on your dotfiles, here you go.

Where the trees live

Worktrees sit right next to the main checkout in <repo>.worktrees/<branch> — no scattering them across /tmp, no losing track of where they went:

~/Developer/
  acme/                       <- the main checkout
  acme.worktrees/
    fix-login/                <- nt fix-login
    team/issue-123-thing/     <- nt team/issue-123-thing

Install

# clone is already at ~/Developer/nt
echo 'source ~/Developer/nt/nt.plugin.zsh' >> ~/.zshrc
exec zsh        # or open a new tab

That one source line defines the nt command and wires up tab completion (it adds completions/ to fpath and registers _nt, even when compinit has already run — as it has under oh-my-zsh). One line. Done.

Usage

Command What it does
nt <branch> [base] spin up / jump to a worktree and cd in
nt cd [branch] cd to an existing worktree (fzf picker if no branch)
nt rm [-f] [target] nuke a worktree (fzf picker if no target)
nt home cd back to the main checkout, wherever you are
nt ls list this repo's worktrees
nt / nt -h list + hint / full usage

Point it at a branch

The argument is the branch you want to be on, and nt figures out the rest — always pulling the latest from origin so you're never stranded on some stale local copy:

  • new name → new branch off the latest origin/main (it fetches first)
  • exists on origin (e.g. nt team/issue-123-foo) → worktree tracking origin/team/issue-123-foo at its latest
  • exists locally → checks the branch out in a fresh worktree, fast-forwarded to origin when that's a clean FF. Diverged local commits? Kept, never clobbered — it just tells you and uses your copy.
  • already has a worktree → skips the theatrics and cds you there
  • nt <name> <base> → fork the new branch off an explicit base instead

Tab completion

  • nt <tab> → subcommands (cd / rm / home / ls) plus existing branch names
  • nt cd <tab> → branches that currently have a worktree
  • nt rm <tab> → every worktree except the main checkout, plus -f. Branch-backed worktrees show by branch name; branch-less (detached) ones — say, created by some other tool — show by full path so they're still reachable.
  • nt <branch> <tab> → branches, to pick a base

Notes & knobs

  • New branches are created --no-track, so a stray git push/git pull won't accidentally nuke main. Push with -u when you're ready.
  • NT_NO_FETCH=1 nt foo skips the network fetch (offline, or just impatient).
  • A local branch is only ever fast-forwarded to origin when it's a clean FF — your diverged local commits are never touched.
  • nt rm <target> takes a branch name, a full worktree path, or a unique path tail (the last path component, usually). An ambiguous tail is refused, with the matches listed. No target → fzf picker over every worktree but the main checkout. Either way it flat-out refuses to remove the main checkout, and if you rm the worktree you're standing in, it steps you back home first.
  • Worktree location is one line in nt.plugin.zsh — change it if you hate it: root="${main_dir:h}/${repo_name}.worktrees".

Tests

  • test/test_nt.zsh — end-to-end behaviour against throwaway repos
  • test/test_completion.zsh — completion registration + candidate generation

MIT.