[Fish] worktree funciton

This commit is contained in:
coja
2026-05-08 14:22:55 +02:00
parent 2163dd70b6
commit f30a7275d0
+24
View File
@@ -0,0 +1,24 @@
function c2-worktree
if test (count $argv) -ne 1
echo "Usage: pkg-worktree <branch-name>"
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