Skip to content

Instantly share code, notes, and snippets.

@mdiener21
Created July 15, 2026 06:02
Show Gist options
  • Select an option

  • Save mdiener21/d9795d72a6e21775536e29be6471fd91 to your computer and use it in GitHub Desktop.

Select an option

Save mdiener21/d9795d72a6e21775536e29be6471fd91 to your computer and use it in GitHub Desktop.
git worktree alias for my bash
git config --global alias.wta '!f() { git worktree add -b "$1" "../$1"; }; f'
git config --global alias.wtr '!f() { git worktree remove "../$1"; }; f'
git config --global alias.wtl '!f() { git worktree list; }; f'
@mdiener21

Copy link
Copy Markdown
Author

List worktrees

git wtl

Add a worktree

git wta name-of-my-worktree

Remove a worktree

git wtr name-of-my-worktree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment