{"id":19124481,"url":"https://github.com/emgyrz/git-switch-fzf","last_synced_at":"2026-04-12T01:38:32.559Z","repository":{"id":225548690,"uuid":"766262748","full_name":"emgyrz/git-switch-fzf","owner":"emgyrz","description":"Interactive search for branches and switching between them. Interactive 'git switch'/'git checkout'","archived":false,"fork":false,"pushed_at":"2024-03-04T21:27:52.000Z","size":889,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T09:19:39.668Z","etag":null,"topics":["bash","cli","fuzzy-search","fzf","fzf-scripts","git","git-branch","git-checkout","git-switch","script","terminal","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emgyrz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-02T19:24:11.000Z","updated_at":"2024-03-02T22:40:37.000Z","dependencies_parsed_at":"2024-11-09T05:40:00.347Z","dependency_job_id":null,"html_url":"https://github.com/emgyrz/git-switch-fzf","commit_stats":null,"previous_names":["emgyrz/git-switch-fzf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emgyrz%2Fgit-switch-fzf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emgyrz%2Fgit-switch-fzf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emgyrz%2Fgit-switch-fzf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emgyrz%2Fgit-switch-fzf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emgyrz","download_url":"https://codeload.github.com/emgyrz/git-switch-fzf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240183762,"owners_count":19761439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bash","cli","fuzzy-search","fzf","fzf-scripts","git","git-branch","git-checkout","git-switch","script","terminal","zsh"],"created_at":"2024-11-09T05:29:20.181Z","updated_at":"2026-04-12T01:38:32.503Z","avatar_url":"https://github.com/emgyrz.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-switch-fzf\n\nSimple bash wrapper around [git](https://github.com/git/git) and [fzf](https://github.com/junegunn/fzf) \nfor interactively search branches( \u0026 tags ) and switching (and more) to them. \n\nDo `git switch` or `git checkout` faster without remembering branch names!\n\n\n![screenshot](./img/screenshot.png \"screenshot\")\n\u003cdetails\u003e\n  \u003csummary\u003eUsage example in GNOME/gtk repository\u003c/summary\u003e\n  \u003cvideo width=\"640\" src=\"https://github.com/emgyrz/git-switch-fzf/assets/12197614/647f8f8e-926d-49e9-ad3e-0c4a8f11d7b8\"\u003e\u003c/video\u003e  \n\u003c/details\u003e\n\n\n## Install\n\nMake sure that `fzf` is installed.\n```shell\n# on deb-based linux for example\nsudo apt-get install fzf\n\n# on mac\nbrew install fzf\n```\n\nThen copy git-switch-fzf script to some dir that is in your `$PATH` variable. See [this](https://stackoverflow.com/a/20054809)\n\n___\n\nOr you can run `install.sh` from this repo.\n\n```shell\n  git clone --depth=1 https://github.com/emgyrz/git-switch-fzf ./git-switch-fzf-tmp \u0026\u0026 \\\n  (./git-switch-fzf-tmp/install.sh || true) \u0026\u0026 \\\n  rm -rf ./git-switch-fzf-tmp\n```\n___\n\n#### (Optional) Add short alias\n```shell\n# default behavior\necho 'alias gco=\"git-switch-fzf\"' \u003e\u003e ~/.zshrc\n\n# search in remotes\necho 'alias gcor=\"git-switch-fzf --type remote\"' \u003e\u003e ~/.zshrc \n\n# update current environment\n. ~/.zshrc\n\ngco \n# ...it works\n```\n\n\n## Usage\n\nCopy from `git-switch-fzf --help`\n\nUsage: git-switch-fzf [options]\n\n### Options\n\n#### -t, --type TYPE     \nSpecify `TYPE` of git references where to search. \n\nCan be 'local', 'remote', 'tags' separated with ',' comma. \n\nDefault is 'local'. \n\nShort names are 'l', 'r' and 't'\n  \n#### -r, --remote\nSame as '--type remote'\n  \n#### -e, --exec CMD\nCommand to which the selected value will be passed. \n\nDefault is 'git switch'\n  \n#### --take-hash\nReturn short commit hash instead of branch or tag name\n   \n#### --no-preview\nHide top preview\n  \n#### -h, --help\nPrint help message\n  \n### Examples\n\nBasic usage without args\n```sh\ngit-switch-fzf\n```\n\nSearch in all references\n```sh\ngit-switch-fzf --type local,remote,tags\n# same as \ngit-switch-fzf -t r,t,l\n```\n  \nSearch only in tags\n```sh\ngit-switch-fzf -type t\n```\n\nUse 'checkout' instead of 'switch' \n```sh\ngit-switch-fzf -e \"git checkout\"\n```\n\nJust print to console selected item name\n```sh\ngit-switch-fzf -e echo\n```\n\nPrint to console hash of selected item\n```sh\ngit-switch-fzf -e echo --take-hash\n```\n\nUse returned value in other command, e.g. for write it to file\n```sh\necho \"selected hash is \\$(git-switch-fzf -e echo --take-hash)\" \u003e /tmp/test\n```\n  \n___\nTested and works fine on Linux and macOS. Windows - not tested\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femgyrz%2Fgit-switch-fzf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femgyrz%2Fgit-switch-fzf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femgyrz%2Fgit-switch-fzf/lists"}