{"id":24506177,"url":"https://github.com/pvdb/git-switcher","last_synced_at":"2025-04-14T07:08:52.533Z","repository":{"id":5793504,"uuid":"7007840","full_name":"pvdb/git-switcher","owner":"pvdb","description":"Visual CLI and REPL for easily switching between git tags and branches","archived":false,"fork":false,"pushed_at":"2019-07-10T09:49:43.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T07:08:47.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/pvdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-04T22:09:45.000Z","updated_at":"2019-07-10T09:49:42.000Z","dependencies_parsed_at":"2022-09-22T14:25:56.009Z","dependency_job_id":null,"html_url":"https://github.com/pvdb/git-switcher","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdb%2Fgit-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdb%2Fgit-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdb%2Fgit-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdb%2Fgit-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvdb","download_url":"https://codeload.github.com/pvdb/git-switcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837280,"owners_count":21169374,"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":[],"created_at":"2025-01-21T23:33:24.738Z","updated_at":"2025-04-14T07:08:52.495Z","avatar_url":"https://github.com/pvdb.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git::Switcher\n\n[![Build Status](https://secure.travis-ci.org/pvdb/git-switcher.png)](http://travis-ci.org/pvdb/git-switcher)\n\nVisual CLI and REPL for easily switching between git tags and branches\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'git-switcher'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install git-switcher\n\n## Usage\n\n`cd` into your favourite git repo, and run `git switcher`\n\nIt will present you with a couple of submenus, one each for:\n\n1. all **remote** branches\n1. all **local** branches\n1. all **reachable** tags\n\n*(unless any of them are empty, in which case the corresponding submenu is omitted)*\n\n            REMOTE BRANCHES\n\n    [1]     origin/aaaaaa\n    [2]     origin/bbbbbbb\n    [3]     origin/cccccccc\n    [4]     origin/ddddd\n    [5]     origin/eeeeeee\n    [6]     origin/master ***\n    [7]     origin/ffffff\n    [8]     origin/gggggggggg\n    [9]     origin/pvandenb\n    [10]    origin/hhhh\n\n            LOCAL BRANCHES\n\n    [11]    master ***\n    [12]    pvandenb\n\n            REACHABLE TAGS\n\n    [a]     kernel_open_gets\n    [b]     file_open_each\n    [c]     file_foreach\n    [d]     regexp_compile_match\n    [e]     named_capture_group\n    [f]     use_args_gets\n    [g]     last_read_line\n    [h]     ruby_minus_n\n    [i]     ruby_minus_p\n\n    Your selection \u003e _\n\nIf the current git `HEAD` corresponds to any of the listed branches or tags, then the corresponding menu items are highlighted with `***`\n\nEach menu item is prefixed with a shortcut key, either a *number* (for branches) or else a *letter* (for tags).\n\nIt will next prompt you for your selection as follows:\n\n    Your selection \u003e _\n\nEnter one of the shortcut keys to quickly do a `git checkout` of the corresponding branch or tag.\n\nIt will then redraw the menu, so that the selected branch or tag is now highlighted, and so that the list of reachable tags is updated correspondingly.\n\n`git switcher` will keep looping as described above, until you enter `quit` or else interrupt the script with either `^D` or `^C`.\n\n## Default selection\n\nTo make it easy and convenient to sequentially loop through all branches or tags, `git switcher` will remember your previous selection, and offer the next menu item as the default.\n\nFor example, if you previously selected `11` to switch to the local `master` branch, then the next prompt presented by `git switcher` will be:\n\n    ([12]   pvandenb) \u003e _\n\nTo quickly switch to the `pvandenb` branch, just press `enter` *(without having to enter the corresponding shortcut key)*.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/pvdb/git-switcher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvdb%2Fgit-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvdb%2Fgit-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvdb%2Fgit-switcher/lists"}