Skip to content

Conversation

@jafinn3
Copy link

@jafinn3 jafinn3 commented Sep 8, 2025

Adds numbering & aliasing for branches currently checked out by git worktrees.

Previously, if you were to create a new git worktree, the branch does not get picked up with scm_breeze's numbering:

$ gco -b tmp && gco - && gco -b tmp2 && gco -
$ git worktree add /tmp/scm_breeze_tmp tmp
$ gb
* [1] main
+ tmp
  [3] tmp2
$ gco 2
error: pathspec '+ tmp' did not match any file(s) known to git

With this change, worktrees now appear to the user as "just another branch." Using scm_breeze aliases, you can swap branches seamlessly, using numeric aliases and without needing to manually remember & change directories.

$ gb
* [1] main
+ [2] tmp
  [3] tmp2
$ gco 2
Switching to worktree: /tmp/scm_breeze_tmp

The + distinguishes between branches currently checked out in separate worktrees

Adds numbering & aliasing for branches currently checked out by git worktrees.

Previously, if you were to create a new git worktree, the branch does not get picked up with scm_breeze's numbering:

$ gco -b tmp && gco - && gco -b tmp2 && gco -
$ git worktree add /tmp/scm_breeze_tmp tmp
$ gb
* [1] main
+ tmp
  [3] tmp2
$ gco 2
error: pathspec '+ tmp' did not match any file(s) known to git
With this change, worktrees now appear to the user as "just another branch." Using scm_breeze aliases, you can swap branches seamlessly, using numeric aliases and without needing to manually remember & change directories.

$ gb
* [1] main
+ [2] tmp
  [3] tmp2
$ gco 2
Switching to worktree: /tmp/scm_breeze_tmp
The + distinguishes between branches currently checked out in separate worktrees
Copy link
Member

@ghthor ghthor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so cool, especially the autocd!

I don't use worktrees much, but I'm going to run this locally for a day or 2 and try using worktrees from some things before merging

@ghthor ghthor merged commit b2e9e6a into scmbreeze:main Sep 22, 2025
4 checks passed
@ndbroadbent
Copy link
Member

Awesome thanks so much for this! I've been using worktrees a lot with AI agents too so this is really useful and something I had wanted to fix for a while. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants