{"id":45063246,"url":"https://github.com/ssoriche/git.fish","last_synced_at":"2026-02-19T10:13:21.624Z","repository":{"id":64877425,"uuid":"534658176","full_name":"ssoriche/git.fish","owner":"ssoriche","description":"A collection of fish functions to make git less painful.","archived":false,"fork":false,"pushed_at":"2025-12-22T16:02:17.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-24T04:13:27.315Z","etag":null,"topics":["fish","git"],"latest_commit_sha":null,"homepage":"","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/ssoriche.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":null,"dco":null,"cla":null}},"created_at":"2022-09-09T13:39:16.000Z","updated_at":"2025-12-22T16:02:20.000Z","dependencies_parsed_at":"2024-01-02T23:46:44.948Z","dependency_job_id":null,"html_url":"https://github.com/ssoriche/git.fish","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ssoriche/git.fish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoriche%2Fgit.fish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoriche%2Fgit.fish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoriche%2Fgit.fish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoriche%2Fgit.fish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssoriche","download_url":"https://codeload.github.com/ssoriche/git.fish/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoriche%2Fgit.fish/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29609538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["fish","git"],"created_at":"2026-02-19T10:13:20.879Z","updated_at":"2026-02-19T10:13:21.618Z","avatar_url":"https://github.com/ssoriche.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git.fish\n\nA collection of fish shell functions to enhance your git workflow and make git worktrees more manageable.\n\n## Features\n\nThis package provides several enhanced git commands that integrate seamlessly with your existing git workflow:\n\n- **Smart git worktree management** with automatic upstream branch detection\n- **GitHub pull request workflow** with direct PR-to-worktree creation\n- **Interactive worktree navigation** using fzf\n- **Safe worktree cleanup** with merge verification\n- **Plain text git output** for scripting and automation\n- **Seamless integration** through git subcommand wrapper\n\n## Installation\n\n### Option 1: Using Fisher Plugin Manager (Recommended)\n\nIf you're using [Fisher](https://github.com/jorgebucaran/fisher), you can install directly from the GitHub repository:\n\n```fish\nfisher install ssoriche/git.fish\n```\n\n### Option 2: Manual Installation\n\n1. Clone this repository: `git clone https://github.com/ssoriche/git.fish.git`\n2. Copy the `functions` directory to your fish configuration directory (`~/.config/fish/`)\n3. Restart your fish shell or run `source ~/.config/fish/config.fish`\n\n### Option 3: Direct Function Installation\n\nYou can also copy individual function files to `~/.config/fish/functions/` if you only want specific commands.\n\n## Quick Setup\n\nAfter installation, you may want to set up the standard git abbreviation:\n\n```fish\n# Add to your ~/.config/fish/config.fish\nabbr g git\n```\n\nThis allows you to use the short `g` command for all git operations:\n\n```fish\ng wadd feature-123    # Same as: git wadd feature-123\ng wjump               # Same as: git wjump\ng wclean ~/worktrees  # Same as: git wclean ~/worktrees\n```\n\n## Commands\n\n### Worktree Management\n\n#### `git wadd` / `git-wadd`\n\nCreate a new git worktree and automatically switch to it.\n\n```fish\n# Create worktree with new branch from upstream\ngit wadd feature-123\n# Or with abbreviation: g wadd feature-123\n\n# Create worktree from specific branch\ngit wadd hotfix develop\n# Or: g wadd hotfix develop\n\n# With additional git worktree options\ngit wadd feature-456 origin/main --force\n```\n\n**Features:**\n\n- Automatically detects upstream branch if none specified\n- Creates new branch and worktree in one command\n- Switches to the new worktree directory after creation\n\n#### `git wpr` / `git-wpr`\n\nCreate a git worktree from a GitHub pull request.\n\n```fish\n# Create worktree from PR number\ngit wpr 123\n# Or with abbreviation: g wpr 123\n\n# Create worktree with custom name\ngit wpr 789 my-feature-branch\n# Or: g wpr 789 my-feature-branch\n\n# Preview what would happen\ngit wpr --dry-run 123\n\n# Use different remote\ngit wpr --remote upstream 123\n```\n\n**Features:**\n\n- Fetches PR branch directly from GitHub\n- Creates worktree with automatic naming (pr-NUMBER)\n- Switches to the new worktree directory after creation\n- Supports custom worktree names and remote selection\n\n#### `git bclean` / `git-bclean`\n\nClean up local branches that have been merged to upstream.\n\n```fish\n# Clean up merged branches\ngit bclean\n\n# Preview what would be removed\ngit bclean --dry-run\n\n# Skip specific branches\ngit bclean --skip staging --skip release\n\n# Skip branches matching patterns\ngit bclean --skip \"feature/*\" --skip \"*-wip\"\n\n# Skip multiple branches with comma-separated list\ngit bclean --skip \"staging,release,hotfix/*\"\n\n# Force removal of unmerged branches too (use with caution!)\ngit bclean --force\n\n# Get help\ngit bclean --help\n```\n\n**Features:**\n\n- Automatically detects upstream branch\n- Finds local branches merged to upstream\n- Protects important branches (current, main, master, develop)\n- **Flexible skip patterns** with glob support and multiple formats\n- Safe deletion with confirmation of merge status\n- Comprehensive summary of actions taken\n\n#### `git wclean` / `git-wclean`\n\nClean up worktrees whose commits have been merged to upstream.\n\n```fish\n# Clean up merged worktrees\ngit wclean ~/git/myproject-worktrees\n\n# Preview what would be removed\ngit wclean --dry-run ~/worktrees\n\n# Clean worktrees but keep local branches\ngit wclean --no-delete-branch ~/worktrees\n\n# Get help\ngit wclean --help\n```\n\n**Features:**\n\n- Scans directory for git worktrees\n- Checks if commits are merged to upstream branch\n- Removes only safely merged worktrees\n- **Automatically deletes associated local branches** (unless `--no-delete-branch` is used)\n- Provides detailed summary of actions taken\n\n#### `git wjump` / `git-wjump`\n\nInteractive worktree selector using fzf (fuzzy finder).\n\n```fish\n# Open interactive worktree selector\ngit wjump\n# Or with abbreviation: g wjump\n\n# Start with search query\ngit wjump feature\n# Or: g wjump feature\n```\n\n**Features:**\n\n- Fuzzy search through available worktrees\n- Preview pane showing recent commit history\n- Automatic directory switching\n- Requires: [fzf](https://github.com/junegunn/fzf)\n\n#### `git wrm` / `git-wrm`\n\nSafely remove a single worktree after verifying commits are merged.\n\n```fish\n# Remove worktree after verification\ngit wrm ~/worktrees/feature-branch\n\n# Preview what would happen\ngit wrm --dry-run ~/worktrees/old-feature\n\n# Force removal (use with caution!)\ngit wrm --force ~/worktrees/experimental\n\n# Remove worktree but keep the local branch\ngit wrm --no-delete-branch ~/worktrees/feature-branch\n```\n\n**Features:**\n\n- Verifies commits are merged to upstream before removal\n- Smart upstream branch detection\n- Force option for override (with warnings)\n- **Automatically deletes associated local branch** (unless `--no-delete-branch` is used)\n- Clear feedback and guidance when commits aren't merged\n\n### Utility Commands\n\n#### `cwb`\n\nGet the current working branch name.\n\n```fish\n# Display current branch\ncwb\n# Output: main\n\n# Use in scripts\nset current_branch (cwb)\necho \"Working on: $current_branch\"\n```\n\n#### `git diff-plain` / `git-diff-plain`\n\nRun git diff without pager for plain text output.\n\n```fish\n# Show diff without pager\ngit diff-plain\n\n# Pipe to other tools\ngit diff-plain | grep \"+function\"\n\n# With git diff options\ngit diff-plain --stat HEAD~1\n```\n\n#### `git show-plain` / `git-show-plain`\n\nRun git show without pager for plain text output.\n\n```fish\n# Show commit without pager\ngit show-plain\n\n# Show specific commit\ngit show-plain abc123\n\n# Pipe to processing tools\ngit show-plain HEAD | grep \"Author\"\n```\n\n### Git Wrapper\n\nThe `git` function enhances the standard git command by:\n\n- Automatically detecting and using custom fish functions\n- Falling back to standard git for unrecognized commands\n- Maintaining full compatibility with existing git usage\n\n## Common Workflows\n\n### Creating and Managing Feature Branches\n\n```fish\n# Create a new feature worktree\ngit wadd feature-user-auth\n# Or: g wadd feature-user-auth\n\n# Work on your feature...\n# (commits, pushes, etc.)\n\n# When done, jump back to main worktree\ngit wjump main\n# Or: g wjump main\n\n# Clean up merged worktrees\ngit wclean ~/git/myproject-worktrees\n# Or: g wclean ~/git/myproject-worktrees\n```\n\n### Working with Pull Requests\n\n```fish\n# Review a pull request in a dedicated worktree\ngit wpr 456\n# Or: g wpr 456\n\n# Test the changes, run builds, etc.\n# When done, jump back to your main work\ngit wjump main\n\n# Remove the PR worktree after review\ngit wrm pr-456\n```\n\n### Interactive Worktree Navigation\n\n```fish\n# Quickly switch between worktrees\ngit wjump\n# Or: g wjump\n\n# Search for specific worktrees\ngit wjump hotfix\n# Or: g wjump hotfix\n```\n\n### Safe Worktree Cleanup\n\n```fish\n# Remove a specific worktree safely\ngit wrm ~/worktrees/completed-feature\n\n# Bulk cleanup of merged worktrees\ngit wclean --dry-run ~/worktrees  # Preview first\ngit wclean ~/worktrees            # Actually clean up\n```\n\n### Branch and Worktree Maintenance\n\n```fish\n# Complete cleanup workflow after merging features\ngit bclean --dry-run    # Preview merged branches to remove\ngit bclean              # Remove merged local branches\ngit wclean ~/worktrees  # Clean up merged worktrees\n\n# Selective cleanup with skip patterns\ngit bclean --skip \"staging,release\" --skip \"hotfix/*\"\ngit bclean --dry-run --skip \"*-wip\" --skip \"feature/experimental*\"\n```\n\n## Configuration\n\nAll functions automatically detect your git configuration including:\n\n- Upstream branches (with fallback to `origin/main`)\n- Remote names and branch names\n- Git repository structure\n\nNo additional configuration is required.\n\n## Dependencies\n\n- **fish shell** (obviously!)\n- **git** (version 2.5+ recommended for full worktree support)\n- **fzf** (for `git-wjump` only) - [Installation guide](https://github.com/junegunn/fzf#installation)\n\nOptional tools that enhance the experience:\n\n- **awk** (usually pre-installed)\n- **realpath** (for path resolution)\n\n## Best Practices\n\n1. **Use upstream tracking**: Set up upstream branches for automatic branch detection\n\n   ```fish\n   git branch --set-upstream-to=origin/main\n   ```\n\n2. **Organize worktrees**: Keep worktrees in a dedicated directory\n\n   ```fish\n   mkdir ~/git/myproject-worktrees\n   cd ~/git/myproject\n   git wadd ~/git/myproject-worktrees/feature-123\n   ```\n\n3. **Regular cleanup**: Periodically clean up merged worktrees\n\n   ```fish\n   git wclean --dry-run ~/git/myproject-worktrees\n   ```\n\n4. **Use help**: All functions have comprehensive help\n\n   ```fish\n   git wadd --help\n   git wclean --help\n   # etc.\n   ```\n\n## License\n\nThis project is released under the same license as specified in the LICENSE file.\n\n## Development\n\n### Code Quality \u0026 Testing\n\nThis repository includes comprehensive CI/CD workflows to ensure code quality and functionality:\n\n#### GitHub Actions \u0026 Forgejo Workflows\n\nThe project includes automated testing workflows for both GitHub Actions (`.github/workflows/test.yaml`) and Forgejo (`.forgejo/workflows/test.yaml`) that:\n\n**Linting \u0026 Formatting:**\n\n- ✅ **Syntax checking** using `fish --no-execute`\n- ✅ **Code formatting** validation with `fish_indent`\n- ✅ **Style consistency** enforcement\n\n**Function Testing:**\n\n- ✅ **Multi-version testing** (Fish 3.3.1, 3.6.0, latest)\n- ✅ **Function loading** verification\n- ✅ **Help system** testing\n- ✅ **Cross-platform** compatibility\n\n**Git Integration Testing:**\n\n- ✅ **Git wrapper** functionality\n- ✅ **Repository context** testing\n- ✅ **Branch detection** validation\n\n**Dependency Testing:**\n\n- ✅ **Optional dependencies** (fzf) graceful handling\n- ✅ **Missing dependencies** error handling\n\n**Integration Testing:**\n\n- ✅ **End-to-end** workflow testing\n- ✅ **Real git repository** scenarios\n\n#### Running Tests Locally\n\nTo run the same tests locally:\n\n```fish\n# Check syntax\nfish --no-execute functions/*.fish\n\n# Check formatting\nfor file in functions/*.fish\n    fish_indent \u003c $file \u003e /tmp/(basename $file)\n    diff -u $file /tmp/(basename $file)\nend\n\n# Test function loading\nfish -c \"\n    set -p fish_function_path $PWD/functions\n    for func_file in functions/*.fish\n        source \\$func_file\n        echo 'Loaded: '(basename \\$func_file .fish)\n    end\n\"\n```\n\n#### Code Standards\n\nAll functions follow the standards defined in `.fishcheck.yaml`:\n\n- **Formatting**: 4-space indentation, 100-character line limit\n- **Naming**: kebab-case for functions, snake_case for variables\n- **Documentation**: Required description, help option, examples, exit codes\n- **Best Practices**: argparse usage, local variables, error handling\n- **Git Integration**: Upstream detection, helpful error messages\n\n### Contributing\n\n1. **Fork the repository**\n2. **Create a feature branch**: `git checkout -b feature/new-command`\n3. **Follow code standards** (see `.fishcheck.yaml`)\n4. **Add comprehensive documentation** and examples\n5. **Test your changes** locally\n6. **Submit a pull request**\n\nAll pull requests automatically run the full test suite to ensure quality and compatibility.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssoriche%2Fgit.fish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssoriche%2Fgit.fish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssoriche%2Fgit.fish/lists"}