Created
June 1, 2025 00:15
-
-
Save skeptrunedev/1e21290b3e4e86142c3d6c2366014a23 to your computer and use it in GitHub Desktop.
remove all git worktrees which are not main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git worktree list | tail -n +2 | awk -F "[" '{print $2}' | awk -F "]" '{print $1}' | grep -v main | xargs -r -I{} git worktree remove --force {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment