[Fish] worktree funciton
This commit is contained in:
1 parent
2163dd70b6
commit
f30a7275d0
1 file changed
+24
@@ -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
|
||||||
Reference in new issue
Block a user