Skip to content

Commit 5407dc0

Browse files
committed
feat(aliases): add worktree cleanup alias
1 parent e275cc5 commit 5407dc0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

include/aliases

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ alias pushf='git push --force-with-lease origin $(git branch --show-current)'
4949
alias branch='git branch'
5050
alias checkout='git checkout'
5151
alias gc_branches='git branch | grep -v "^* $(git branch --show-current)$" | xargs git branch -D'
52+
alias gc_worktrees="git worktree list --porcelain | awk '/^worktree / { if (++count > 1) print substr(\$0, 10) }' | xargs -I {} git worktree remove '{}'"
5253
alias sync_submodules='git submodule update --init --recursive'
5354
# gh
5455
alias pr='gh pr create'

0 commit comments

Comments
 (0)