뉴스피드 큐레이션 SNS 대시보드 저널

HN 표시: Git 분기를 Thanos 스타일로 분해하는 TUI를 구축했습니다.

hackernews | | 💼 비즈니스
#cli #git #tui #개발 팁 #브랜치 관리

요약

개발자 아르멘이는 ratatui 기반의 Rust CLI/TUI 툴인 'deadbranch'를 공개했으며, 이 툴은 병합된 브랜치만 자동으로 식별해 삭제하는 등 안전한 정리 기능을 제공합니다. 최신 버전(v0.3.0)의 가장 큰 특징은 브랜치를 삭제할 때 타노스 스타일의 입자 파괴 효과가 화면에 구현된다는 점입니다. 사용자는 퍼지 검색과 Vim 탐색을 지원하는 인터페이스를 통해 삭제될 브랜치를 미리 확인할 수 있으며, 백그라운드 스레드 처리 덕분에 삭제 작업 중에도 UI가 끊기지 않고 반응형을 유지합니다.

왜 중요한가

개발자 관점

검토중입니다

연구자 관점

검토중입니다

비즈니스 관점

검토중입니다

본문

Clean up stale git branches safely. - Demo - Features - Installation - Shell Completions - Quick Start - Usage - Safety Features - Restoring Deleted Branches - Pattern Matching - Requirements - Roadmap - License - Contributing deadbranch helps you identify and remove old, unused git branches that clutter your repository. It's designed to be safe by default — protecting important branches and requiring explicit confirmation before any deletion. - 🔍 List stale branches — Find branches older than N days (default: 30) - 🔒 Safe deletion — Only deletes merged branches by default - 🛡️ Protected branches — Never touches main ,master ,develop ,staging , orproduction - 🚧 WIP detection — Automatically excludes wip/* anddraft/* branches - 💾 Backup creation — Saves deleted branch SHAs for easy restoration - 👁️ Dry-run mode — Preview what would be deleted without making changes - 🌐 Local & remote — Works with both local and remote branches - 🖥️ Interactive TUI mode — Full-screen TUI with Vim navigation, fuzzy search, visual range selection, and 6-column sorting curl -sSf https://raw.githubusercontent.com/armgabrielyan/deadbranch/main/install.sh | sh brew install armgabrielyan/tap/deadbranch # Install globally npm install -g deadbranch # Or run directly npx deadbranch list cargo install deadbranch Download pre-built binaries from the GitHub Releases page. | Platform | Architecture | Download | |---|---|---| | Linux | x86_64 (glibc) | deadbranch-VERSION-x86_64-unknown-linux-gnu.tar.gz | | Linux | x86_64 (musl/static) | deadbranch-VERSION-x86_64-unknown-linux-musl.tar.gz | | Linux | ARM64 | deadbranch-VERSION-aarch64-unknown-linux-gnu.tar.gz | | macOS | Intel | deadbranch-VERSION-x86_64-apple-darwin.tar.gz | | macOS | Apple Silicon | deadbranch-VERSION-aarch64-apple-darwin.tar.gz | | Windows | x86_64 | deadbranch-VERSION-x86_64-pc-windows-msvc.zip | git clone https://github.com/armgabrielyan/deadbranch cd deadbranch cargo build --release # Binary will be at target/release/deadbranch deadbranch can generate tab-completion scripts for bash, zsh, and fish. mkdir -p ~/.local/share/bash-completion/completions deadbranch completions bash > ~/.local/share/bash-completion/completions/deadbranch Requires bash-completion 2.x to be active. On macOS without Homebrew's bash, source the file manually in ~/.bash_profile : source ~/.local/share/bash-completion/completions/deadbranch mkdir -p ~/.zfunc deadbranch completions zsh > ~/.zfunc/_deadbranch Then add the following to your ~/.zshrc before the compinit call (or add it if you don't have one): fpath=(~/.zfunc $fpath) autoload -Uz compinit && compinit Reload your shell or run exec zsh to activate. mkdir -p ~/.config/fish/completions deadbranch completions fish > ~/.config/fish/completions/deadbranch.fish Fish auto-loads completions from this directory — no extra configuration needed. # List all stale branches (older than 30 days) deadbranch list # List branches older than 60 days deadbranch list --days 60 # Preview what would be deleted deadbranch clean --dry-run # Delete merged stale branches (with confirmation) deadbranch clean # Delete only local branches deadbranch clean --local # Show branch health overview deadbranch stats deadbranch list [OPTIONS] | Option | Description | |---|---| -d, --days | Only show branches older than N days (default: 30) | --local | Only show local branches | --remote | Only show remote branches | --merged | Only show merged branches | Example output: ℹ Using 'main' as the default branch for merge detection Local Branches: ┌────┬──────────────────────┬─────────┬────────┬───────┬──────────────┬──────────────┐ │ # │ Branch │ Age │ Status │ Type │ Last Commit │ Author │ ├────┼──────────────────────┼─────────┼────────┼───────┼──────────────┼──────────────┤ │ 1 │ feature/old-api │ 154d │ merged │ local │ 2024-09-01 │ Jane Doe │ │ 2 │ bugfix/header-issue │ 89d │ merged │ local │ 2024-11-03 │ John Smith │ └────┴──────────────────────┴─────────┴────────┴───────┴──────────────┴──────────────┘ Remote Branches: ┌────┬─────────────────────────────────┬─────────┬────────┬────────┬──────────────┬──────────────┐ │ # │ Branch │ Age │ Status │ Type │ Last Commit │ Author │ ├────┼─────────────────────────────────┼─────────┼────────┼────────┼──────────────┼──────────────┤ │ 1 │ origin/feature/deprecated │ 203d │ merged │ remote │ 2024-07-15 │ Jane Doe │ └────┴─────────────────────────────────┴─────────┴────────┴────────┴──────────────┴──────────────┘ deadbranch clean [OPTIONS] | Option | Description | |---|---| -d, --days | Only delete branches older than N days (default: 30) | --merged | Only delete merged branches (this is the default) | --force | Force delete unmerged branches (dangerous!) | --dry-run | Show what would be deleted without doing it | --local | Only delete local branches | --remote | Only delete remote branches | -y, --yes | Skip confirmation prompts (useful for scripts) | Safety features: - Only deletes merged branches by default - Requires --force to delet

관련 저널 읽기

전체 보기 →