kota's memex

I often want to compare two branches in git. Often these are both local and experimental branches. I used to just copy my current repo into a different folder, but it turns out there's a much easier and faster built-in git tool for this! Because of course there is lol!

git worktree

add

By default add creates a new directory and similarly named branch: git worktree add ../experiment

Most of the time I want to specify and existing branch instead: git worktree add ../experiment vulkan-support

There are also subcommands to remove, list, and move which work as you would expect.