Add worktree sync subcommand

This `worktree sync` subcommand follows on from removing symbolic links
from `worktree add` to update all worktrees which don't have the latest
version of shared files from the root worktree.
This commit is contained in:
2026-04-28 10:43:06 +01:00
parent 03fda0cde7
commit 8877017ae7
2 changed files with 46 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ _worktree() {
'ls:List managed worktrees'
'remove:Remove a worktree by branch'
'rm:Remove a worktree by branch'
'sync:Sync copied files from root to worktrees'
)
_describe -t commands 'worktree command' commands "$@"
;;
@@ -44,6 +45,9 @@ _worktree() {
(rm|remove)
_arguments '*:: :__worktree_active_branches'
;;
(sync)
_arguments '*:: :__worktree_active_branches'
;;
esac
;;
esac