Re: Feature request: support listing worktrees sorted by creation time
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Mar 5, 2026, 07:35 UTC
- Message-ID
- <264862d1-0f83-4d0b-be11-d8e479c7d8da@kdbg.org>
- In-Reply-To
- <CAM+g_Nt8vZX4NxPvddJxNvSRgdMWQaLg2O9xzAU1pTHa=Et-gw@mail.gmail.com>
Am 05.03.26 um 08:14 schrieb Norbert Kiesel:
Show 6 quoted lines
> I have multiple repos with more than 20 worktrees, and sometimes > forget the name of a recently added worktree. Therefore it would > really be nice if I could use something like ‘git worktree list > —created’ to list them by their creation timestamp. Is that something > that makes sense to you as well? I could also create a pull request > for this if you would like it.
I don't think this is warranted as a feature for a special-purpose use-case. Assuming you don't have spaces in your worktree directory names,
git worktree list | cut -d' ' -f1 | xargs ls -ldtr
lists the worktree directories by modification time. The last is the one that was modified most recently. That should help your memory.
-- Hannes