{"id":44889763,"url":"https://github.com/ahmedelgabri/git-wt","last_synced_at":"2026-02-22T16:36:01.182Z","repository":{"id":337383000,"uuid":"1147967876","full_name":"ahmedelgabri/git-wt","owner":"ahmedelgabri","description":"A git custom command that enhances Git's native worktree functionality with interactive features, automation, and repository migration capabilities.","archived":false,"fork":false,"pushed_at":"2026-02-17T19:59:30.000Z","size":239,"stargazers_count":43,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-17T21:54:52.530Z","etag":null,"topics":["git","worktrees"],"latest_commit_sha":null,"homepage":"https://ahmedelgabri.github.io/git-wt","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmedelgabri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-02T12:24:46.000Z","updated_at":"2026-02-17T18:30:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ahmedelgabri/git-wt","commit_stats":null,"previous_names":["ahmedelgabri/git-wt"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ahmedelgabri/git-wt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelgabri%2Fgit-wt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelgabri%2Fgit-wt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelgabri%2Fgit-wt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelgabri%2Fgit-wt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedelgabri","download_url":"https://codeload.github.com/ahmedelgabri/git-wt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedelgabri%2Fgit-wt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29718468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","worktrees"],"created_at":"2026-02-17T18:38:56.994Z","updated_at":"2026-02-22T16:36:01.174Z","avatar_url":"https://github.com/ahmedelgabri.png","language":"Shell","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003ccenter\u003e\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/logo-dark.svg\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"docs/logo-light.svg\"\u003e\n  \u003cimg alt=\"Logo\" src=\"docs/logo-light.svg\"\u003e\n\u003c/picture\u003e\n\u003c/center\u003e\n\n# git-wt\n\nA git custom command that enhances Git's native worktree functionality with\ninteractive features, automation, and repository migration capabilities.\n\ngit-wt uses a [**bare repository** structure](https://gabri.me/blog/git-worktrees-done-right)\nwhere the git data lives in a `.bare` directory and each branch gets its own\nworktree directory. This provides better organization and a cleaner workspace\ncompared to the traditional `.git`-in-root approach.\n\n## Why git worktrees?\n\nGit worktrees allow you to have multiple branches checked out simultaneously in\ndifferent directories. This is useful for:\n\n- Working on multiple features in parallel without stashing\n- Reviewing PRs while keeping your work intact\n- Running tests on one branch while developing on another\n- Comparing implementations across branches side-by-side\n\n## Features\n\n- **Bare clone structure** - Git data in `.bare/`, each branch in its own\n  directory\n- **Interactive branch selection** with fzf for creating and switching worktrees\n- **Repository migration** - convert existing repos to worktree structure\n- **Automatic upstream tracking** when creating worktrees from remote branches\n- **Multi-select support** for batch operations (remove, destroy)\n- **Dry-run mode** for destructive operations\n- **Preserves uncommitted changes** during migration (staged, unstaged, stashes)\n\n## Dependencies\n\n- `git` (2.48.0+ for relative worktree support)\n\n## Installation\n\n### Using Homebrew\n\n```bash\nbrew tap ahmedelgabri/git-wt\nbrew install git-wt\n```\n\nShell completions are automatically installed for bash, zsh, and fish.\n\n### Using Nix Flakes\n\nAdd to your flake inputs:\n\n```nix\n{\n  inputs.git-wt.url = \"github:ahmedelgabri/git-wt\";\n}\n```\n\nThen add to your packages:\n\n```nix\ninputs.git-wt.packages.${system}.default\n```\n\nOr run directly:\n\n```bash\nnix run github:ahmedelgabri/git-wt\n```\n\nShell completions are automatically available when installed via Nix.\n\n### Manual Installation\n\nDownload the latest release archive for your platform from the\n[releases page](https://github.com/ahmedelgabri/git-wt/releases/latest):\n\n```bash\n# Example for macOS ARM (Apple Silicon)\ncurl -sL https://github.com/ahmedelgabri/git-wt/releases/latest/download/git-wt-VERSION-darwin-arm64.tar.gz | tar xz\ncp git-wt-VERSION-darwin-arm64/git-wt ~/.local/bin/\n```\n\nReplace `VERSION` with the actual version number (e.g. `1.0.0`) and choose the\nright OS/architecture: `darwin-amd64`, `darwin-arm64`, `linux-amd64`, or\n`linux-arm64`.\n\n### Shell Completions\n\nWhen installed via Homebrew or Nix, completions are automatically available.\n\nFor manual installation, the release archives include a `completions/` directory\nwith scripts for bash, zsh, and fish:\n\n```bash\n# Bash\ncp completions/git-wt.bash ~/.local/share/bash-completion/completions/git-wt\n\n# Zsh\ncp completions/_git-wt ~/.local/share/zsh/site-functions/_git-wt\n\n# Fish\ncp completions/git-wt.fish ~/.config/fish/completions/git-wt.fish\n```\n\n## Usage\n\n### Clone a repository with worktree structure\n\n```bash\ngit wt clone https://github.com/user/repo.git\n```\n\nThis creates:\n\n```\nrepo/\n├── .bare/          # Git data (bare repository)\n├── .git           # Points to .bare\n└── main/          # Worktree for default branch\n```\n\n### Migrate an existing repository (Experimental)\n\n```bash\ncd existing-repo\ngit wt migrate\n```\n\nConverts your repo to the worktree structure while preserving all uncommitted\nchanges, staged files, and stashes.\n\n### Create a new worktree\n\n```bash\n# Interactive mode - select from remote branches with fzf\ngit wt add\n\n# From a remote branch\ngit wt add feature origin/feature\n\n# Create new branch\ngit wt add -b new-feature new-feature\n\n# All git worktree add flags are supported\ngit wt add --detach hotfix HEAD~5     # Detached HEAD\ngit wt add --lock -b wip wip-branch   # Locked worktree\ngit wt add --quiet -b feature feature # Suppress output\n```\n\n### Switch between worktrees\n\n```bash\ncd $(git wt switch)\n```\n\n### Remove worktrees\n\n```bash\n# Interactive multi-select\ngit wt remove\n\n# Direct removal (local branch only)\ngit wt remove feature-branch\n\n# Preview what would be removed\ngit wt remove --dry-run\n```\n\n### Destroy worktrees (removes remote branch too)\n\n```bash\n# Interactive with confirmation\ngit wt destroy\n\n# Direct destruction\ngit wt destroy feature-branch\n```\n\n### Update default branch\n\n```bash\ngit wt update # or: git wt u\n```\n\nFetches all remotes and pulls the default branch (main/master).\n\n### List worktrees\n\n```bash\ngit wt list\n```\n\n## Commands\n\n| Command              | Description                                                |\n| -------------------- | ---------------------------------------------------------- |\n| `clone \u003curl\u003e`        | Clone repo with worktree structure                         |\n| `migrate`            | Convert existing repo to worktree structure (experimental) |\n| `add [options] ...`  | Create new worktree (supports all git worktree flags)      |\n| `remove` / `rm`      | Remove worktree and local branch                           |\n| `destroy [worktree]` | Remove worktree and delete local + remote branches         |\n| `update` / `u`       | Fetch all and update default branch                        |\n| `switch`             | Interactive worktree selection                             |\n\nAll native `git worktree` commands (list, lock, unlock, move, prune, repair) are\nalso supported as pass-through.\n\n## Development\n\n```bash\n# Enter development shell\nnix develop\n\n# Format code\nnix fmt\n\n# Run checks\nnix flake check\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedelgabri%2Fgit-wt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedelgabri%2Fgit-wt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedelgabri%2Fgit-wt/lists"}