1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-30 21:57:44 +00:00

Enhance gwta (#1143)

Allow automatic association to an existing branch or creation of new
branch with `gwta` when 2nd positional parameter (`branch`) is omitted.
This commit is contained in:
Sandyandi N. dela Cruz 2025-07-17 19:53:13 +08:00 committed by GitHub
parent b09b60cc43
commit ba9a4c1cac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -225,8 +225,12 @@ export alias gupav = git pull --rebase --autostash --verbose
export alias gwch = git whatchanged -p --abbrev-commit --pretty=medium
export alias gwt = git worktree
export def gwta [path: path, branch: string] {
git worktree add $path $branch
export def gwta [path: path, branch?: string] {
if $branch != null {
git worktree add $path $branch
} else {
git worktree add $path
}
}
export alias gwtls = git worktree list
export alias gwtmv = git worktree move
@ -239,3 +243,4 @@ export alias gamc = git am --continue
export alias gams = git am --skip
export alias gama = git am --abort
export alias gamscp = git am --show-current-patch