{"id":21261506,"url":"https://github.com/chenasraf/git-open","last_synced_at":"2026-02-17T12:14:42.876Z","repository":{"id":252829754,"uuid":"841580445","full_name":"chenasraf/git-open","owner":"chenasraf","description":"Git aliases for opening project, branch, commit, PRs, etc from CLI","archived":false,"fork":false,"pushed_at":"2024-08-21T12:34:25.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-21T13:38:10.437Z","etag":null,"topics":["alias","git","git-command"],"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/chenasraf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"chenasraf","patreon":null,"open_collective":null,"ko_fi":"casraf","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=TSH3C3ABGQM22\u0026currency_code=ILS\u0026source=url"]}},"created_at":"2024-08-12T17:31:54.000Z","updated_at":"2024-08-21T13:22:30.000Z","dependencies_parsed_at":"2024-08-19T13:18:19.918Z","dependency_job_id":"a9b4d133-20d6-47d9-bb91-56884e931e2d","html_url":"https://github.com/chenasraf/git-open","commit_stats":null,"previous_names":["chenasraf/git-open"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fgit-open","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fgit-open/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fgit-open/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fgit-open/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenasraf","download_url":"https://codeload.github.com/chenasraf/git-open/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225675083,"owners_count":17506272,"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":["alias","git","git-command"],"created_at":"2024-11-21T04:43:36.411Z","updated_at":"2026-02-17T12:14:42.871Z","avatar_url":"https://github.com/chenasraf.png","language":"Shell","readme":"# git-open\n\ngit-open is a git alias which lets you open various repository URLs in a project in your\ndefault browser. It makes it easy to find a project, a specific commit, a branch or PR on GitHub, GitLab and Bitbucket.\n\nFor example:\n\n```sh\ngit open repo # open project main URL\ngit open prs # open PRs/MRs list\ngit open branch # open current branch URL\ngit open branch some/branch # open specific branch\ngit open commit # open current commit URL\ngit open commit abc123 # open specific commit URL\ngit open file .gitignore # open specific file URL\n```\n\nYou can always use `git open` without arguments to see the list of possible options:\n\n\u003c!--HELP_OUTPUT_START--\u003e\n```sh\nUsage: git open [-s] \u003ccommand\u003e\n\nOpens various Git project related URLs in your browser.\n\nCommands:\n  project|repo[sitory]|open|.    Open the project\n  branch                         Open the project at given (or current) branch\n  commit                         Open the project at given (or current) commit\n  file                           Open the project at given file\n  file \u003cbranch|commit|ref\u003e       Open the project at given file for given ref\n  prs|mrs                        Open the PR list\n  pr|mr                          Create a new PR or open existing one\n  pr|mr \u003csource branch\u003e          Create a new PR or open existing one for given branch\n  pr|mr \u003csource\u003e \u003ctarget\u003e        Create a new PR or open existing one for given source and target\n  actions|pipelines|ci           Open the CI/CD pipelines\n\nFlags:\n  -s, --silent                   Silent mode (no output)\n```\n\u003c!--HELP_OUTPUT_END--\u003e\n\n## Installation\n\nThere are several methods to install git-open:\n\n### Manually\n\n1. Clone the git repository:\n   ```sh\n   cd $installpath\n   git clone https://github.com/chenasraf/git-open.git\n   ```\n\n2. Load the entry file somewhere in your init (such as `~/.zshrc`):\n   ```sh\n   source /path/to/git-open/git-open.plugin.zsh\n   ```\n\n   Alternatively, you can add the following value to your git config to load manually:\n   ```sh\n   git config --global alias.open \"!/path/to/git-open/git-open.zsh open\"\n   ```\n\n### Zplug\n\n```sh\nzplug \"chenasraf/git-open\"\n```\n\n## Adding to your tools\n\nFeel free to post configurations you have come up with as a PR.\n\n### Adding to Neovim\n\nYou can add a command, a keybinding, or both to your Neovim config files.\nHere is a starter template you can use, feel free to adjust to your needs.\n\n```lua\n-- :GitOpen command\n-- usage: :GitOpen [...args]\nvim.api.nvim_create_user_command('GitOpen', function(opts)\n  local args = opts.args\n  local cmd = \"git open\"\n  if #args \u003e 0 then\n    cmd = cmd .. \" \" .. args\n    vim.cmd(\":silent !\" .. cmd)\n  else\n    local types = { \"branch\", \"pr\", \"prs\", \"repo\", \"commit\", \"file\" }\n    local type_map = {\n      repo = \"Project\",\n      branch = \"Current branch\",\n      commit = \"Commit\",\n      file = \"File\",\n      pr = \"Create/open Pull Request\",\n      prs = \"PRs list\"\n    }\n    vim.ui.select(types, {\n      prompt = \"Git open\",\n      format_item = function(item) return type_map[item] end\n    }, function(selected)\n      local extras = \"\"\n      if selected == \"file\" then\n        extras = vim.fn.expand(\"%\")\n      end\n      if extras ~= \"\" then\n        selected = selected .. \" \" .. extras\n      end\n      vim.cmd(\"GitOpen \" .. selected)\n    end)\n  end\nend, { nargs = '*' })\n\n-- keymaps\nvim.keymap.set(\"n\", \"\u003cleader\u003ego\", \":GitOpen\u003cCR\u003e\", { desc = \"Git open\", silent = true })\nvim.keymap.set(\"n\", \"\u003cleader\u003egOp\", \":GitOpen repo\u003cCR\u003e\", { desc = \"Git open repo\", silent = true })\nvim.keymap.set(\"n\", \"\u003cleader\u003egOb\", \":GitOpen branch\u003cCR\u003e\", { desc = \"Git open branch\", silent = true })\nvim.keymap.set(\"n\", \"\u003cleader\u003egOc\", \":GitOpen commit\u003cCR\u003e\", { desc = \"Git open commit\", silent = true })\nvim.keymap.set(\"n\", \"\u003cleader\u003egOf\", \":GitOpen file\u003cCR\u003e\", { desc = \"Git open file\", silent = true })\n```\n\n### Adding to LazyGit\n\nYou can add `git-open` to your `lazygit` config file and open selected files/refs with it.\nHere is an example `customCommands` entry, but you can of course modify it or create your own:\n\n```yaml\ncustomCommands:\n  - key: 'B'\n    context: 'global'\n    prompts:\n      - type: 'menu'\n        title: 'Choose an action'\n        key: 'action'\n        options:\n          - name: 'Open Branch'\n            value: 'branch'\n          - name: 'Open Default Branch'\n            value: 'project'\n          - name: 'Open Commit'\n            value: 'commit'\n          - name: 'Open File'\n            value: 'file'\n          - name: 'Create/open Pull Request'\n            value: 'pr'\n          - name: 'Open Pull Requests'\n            value: 'prs'\n          - name: 'Open CI/Actions'\n            value: 'ci'\n    # pass selected contexts to `git open`, prefer file, then remote branch, then local branch\n    command: |\n      ACTION={{.Form.action | quote}}\n      FILE={{if .SelectedFile}}{{.SelectedFile.Name | quote}}{{end}}\n      REMOTE_BRANCH={{if .SelectedRemoteBranch}}{{.SelectedRemoteBranch.Name | quote}}{{end}}\n      LOCAL_BRANCH={{if .SelectedLocalBranch}}{{.SelectedLocalBranch.Name | quote}}{{end}}\n      COMMIT={{if .SelectedCommit}}{{.SelectedCommit.Sha | quote}}{{end}}\n      case \"$ACTION\" in\n        branch) ARG=\"$REMOTE_BRANCH\";;\n        commit) ARG=\"$COMMIT\";;\n        file) ARG=\"$FILE\";;\n        pr)\n          ARG=\"$LOCAL_BRANCH\"\n          if [[ -n \"$REMOTE_BRANCH\" ]]; then\n            ARG=$ARG $REMOTE_BRANCH\n          fi\n          ;;\n        project) ARG=\"\";;\n        prs) ARG=\"\";;\n        ci) ARG=\"\";;\n        *) ARG=\"\";;\n      esac\n      git open $ACTION $ARG\n    loadingText: 'Opening...'\n```\n\n## Contributing\n\nI am developing this package on my free time, so any support, whether code, issues, or just stars is\nvery helpful to sustaining its life. If you are feeling incredibly generous and would like to donate\njust a small amount to help sustain this project, I would be very very thankful!\n\n\u003ca href='https://ko-fi.com/casraf' target='_blank'\u003e\n  \u003cimg height='36' style='border:0px;height:36px;'\n    src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3'\n    alt='Buy Me a Coffee at ko-fi.com' /\u003e\n\u003c/a\u003e\n\nI welcome any issues or pull requests on GitHub. If you find a bug, or would like a new feature,\ndon't hesitate to open an appropriate issue and I will do my best to reply promptly.\n\n","funding_links":["https://github.com/sponsors/chenasraf","https://ko-fi.com/casraf","https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=TSH3C3ABGQM22\u0026currency_code=ILS\u0026source=url","https://ko-fi.com/casraf'"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fgit-open","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenasraf%2Fgit-open","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fgit-open/lists"}