From 8c9d0e13bf1765940bcacb775df66cc119390534 Mon Sep 17 00:00:00 2001 From: zhangym <40376181+zhangymPerson@users.noreply.github.com> Date: Thu, 25 Apr 2024 20:44:17 +0800 Subject: [PATCH] feat: add git worktree command (#824) --- custom-completions/git/git-completions.nu | 67 +++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/custom-completions/git/git-completions.nu b/custom-completions/git/git-completions.nu index 3d3850c..d5bd103 100644 --- a/custom-completions/git/git-completions.nu +++ b/custom-completions/git/git-completions.nu @@ -491,3 +491,70 @@ export extern "git bisect reset" [ export extern "git help" [ command: string@"nu-complete git subcommands" # subcommand to show help for ] + +# git worktree +export extern "git worktree" [ + --help(-h) # display the help message for this command + ...args +] + +# create a new working tree +export extern "git worktree add" [ + --help(-h) # display the help message for this command + --force(-f) # checkout even if already checked out in other worktree + -b # create a new branch + -B # create or reset a branch + --detach(-d) # detach HEAD at named commit + --checkout # populate the new working tree + --lock # keep the new working tree locked + --reason # reason for locking + --quiet(-q) # suppress progress reporting + --track # set up tracking mode (see git-branch(1)) + --guess-remote # try to match the new branch name with a remote-tracking branch + ...args +] + +# list details of each worktree +export extern "git worktree list" [ + --help(-h) # display the help message for this command + --porcelain # machine-readable output + --verbose(-v) # show extended annotations and reasons, if available + --expire # add 'prunable' annotation to worktrees older than