
ALT panel 1: git worktree lets you have 2 branches checked out at the same time person: "ugh, I want to take a look at this other branch, but I have all these uncommitted changes..." git worktree: "i can help!" panel 2: creating a worktree git worktree add ~/my/repo mybranch Then you can run any normal git commands in the new directory: $ cd ~/my/repo $ git pull panel 3: two worktrees can't have the same branch checked out Here's what happens if you try: $ git checkout main fatal: 'main' is already checked out at /home/bork/work/homepage panel 4: it's way faster (and uses less space!) than cloning the repository again Because worktrees share a .git directory, it just needs to check out the files from the branch you want to use! panel 5: other worktree commands List all worktrees: $ git worktree list Delete a worktree: $ git worktree remove ~/my/repo panel 6: sometimes I use worktrees to keep my .git directory and its checkout separate



