Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I use git worktrees pretty heavily in my own workflows (I worked like an AI agent before AI agents made worktrees cool). I like to track my ephemera/utility scripts in git, so what I do is keep a private ephemera repo for those, and then use `git worktree add` from the collaborative repo to check out the branch I'm working on there into a subdirectory of my ephemera repo.

  git-home/
    company-project/ <-- git repo with main checked out
    ephemera/ <-- my private repo
      my-data-script.py
      work/ <-- gitignored
        company-project-feature-X/ <-- worktree on feature-X branch
        company-project-feature-Y/ <-- worktree on feature-Y branch
      
This way, too, I can easily use the same ephemera scripts across multiple branches, or even multiple repos, concurrently.


How do you manage the lifecycle of the worktrees in practice? Is it mostly manual git worktree add/remove, or do you use aliases/scripts/some other tools?


Oh this is really clever, I'll have to try this. Thank you :)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: