From f30a7275d0203d9bdd69a564ee48f957436054cc Mon Sep 17 00:00:00 2001 From: coja Date: Fri, 8 May 2026 14:22:55 +0200 Subject: [PATCH] [Fish] worktree funciton --- .config/fish/functions/c2-worktree.fish | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .config/fish/functions/c2-worktree.fish diff --git a/.config/fish/functions/c2-worktree.fish b/.config/fish/functions/c2-worktree.fish new file mode 100644 index 0000000..132bfa8 --- /dev/null +++ b/.config/fish/functions/c2-worktree.fish @@ -0,0 +1,24 @@ +function c2-worktree + if test (count $argv) -ne 1 + echo "Usage: pkg-worktree " + echo "Example: pkg-worktree package/package-update" + return 1 + end + + set branch $argv[1] + set dir (basename $branch) + + git checkout -b $branch + or return 1 + + git checkout master + or return 1 + + git worktree add $dir $branch + or return 1 + + cd $dir + or return 1 + + pnpm i +end