Skip to content

v0.0.1

Choose a tag to compare

@github-actions github-actions released this 10 Aug 07:19
· 11 commits to main since this release
f0c84d4

Changelog

  • 5e4d164 Initial commit
  • 9c24978 Merge pull request #1 from liamawhite/initial-func
  • 38d11b7 Merge pull request #2 from liamawhite/release-things
  • 40d2340 Merge pull request #3 from liamawhite/test-fixes
  • 2ae7d8b Merge pull request #4 from liamawhite/more-test-fixes
  • f0c84d4 Merge pull request #5 from liamawhite/more-test-fixes-2
  • b3eab8e Update Claude settings permissions
  • 81b42d4 chore: add license headers and fix linting issues
  • 01da568 dont build windows binaries for now...
  • aad5fd7 feat(shell): improve interactive selector and fix config test leakage
  • 4a98d78 feat: add automatic directory switching for add/switch commands
  • 260c163 feat: add comprehensive worktree management system
  • 8c902cb feat: add git remote verification to integration tests
  • ed49116 feat: add release job to test workflow
  • c4780bf feat: change directory to root when removing current worktree
  • bab6928 fix test wf name
  • f2494f6 fix: resolve linting errors and test failures
  • b30236e more fixes

Installation

Download Binary

Choose the appropriate binary for your platform from the assets below:

Linux (x86_64)

curl -L https://github.com/liamawhite/worktree/releases/download/v0.0.1/worktree_Linux_x86_64.tar.gz | tar xz
chmod +x worktree
sudo mv worktree /usr/local/bin/

Linux (ARM64)

curl -L https://github.com/liamawhite/worktree/releases/download/v0.0.1/worktree_Linux_arm64.tar.gz | tar xz
chmod +x worktree
sudo mv worktree /usr/local/bin/

macOS (Intel)

curl -L https://github.com/liamawhite/worktree/releases/download/v0.0.1/worktree_Darwin_x86_64.tar.gz | tar xz
chmod +x worktree
sudo mv worktree /usr/local/bin/

macOS (Apple Silicon)

curl -L https://github.com/liamawhite/worktree/releases/download/v0.0.1/worktree_Darwin_arm64.tar.gz | tar xz
chmod +x worktree
sudo mv worktree /usr/local/bin/

Verify Installation

worktree --version

Optional: Shell Integration for Directory Switching

To enable automatic directory changes when using worktree add and worktree switch commands, add this function to your shell profile:

(~/.bashrc, ~/.bash_profile, ~/.zshrc):

worktree() {
    local cmd="$1"
    
    # Commands that should change directory
    if [[ "$cmd" == "add" || "$cmd" == "switch" || "$cmd" == "sw" ]]; then
        # Capture stderr to look for WT_CHDIR while preserving stdout and interactive TUI
        local temp_file
        temp_file=$(mktemp)
        
        # Run command with stderr redirected to temp file
        command worktree "$@" 2> >(tee "$temp_file" >&2)
        local exit_code=$?
        
        # Look for directory change indicator in stderr
        local target_dir
        target_dir=$(grep "^WT_CHDIR:" "$temp_file" 2>/dev/null | sed 's/^WT_CHDIR://')
        
        # Clean up temp file
        rm -f "$temp_file"
        
        # Change directory if target was specified
        if [[ -n "$target_dir" && -d "$target_dir" ]]; then
            cd "$target_dir" || echo "Warning: Failed to change to directory: $target_dir"
        fi
        
        return $exit_code
    else
        # For all other commands, just run normally
        command worktree "$@"
    fi
}

After adding this function and restarting your shell (or running source ~/.bashrc/source ~/.zshrc), the worktree add and worktree switch commands will automatically change your current directory to the worktree location.

Verification with Checksums

Download checksums.txt and verify your binary:

sha256sum -c checksums.txt

Released by GoReleaser.