{"id":13563657,"url":"https://github.com/caarlos0-graveyard/zsh-open-pr","last_synced_at":"2026-01-23T06:13:19.639Z","repository":{"id":25189734,"uuid":"28613181","full_name":"caarlos0-graveyard/zsh-open-pr","owner":"caarlos0-graveyard","description":"Open pull requests from the command line.","archived":false,"fork":false,"pushed_at":"2022-06-15T02:09:19.000Z","size":1368,"stargazers_count":65,"open_issues_count":2,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-21T13:51:29.273Z","etag":null,"topics":[],"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/caarlos0-graveyard.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}},"created_at":"2014-12-30T01:37:29.000Z","updated_at":"2024-05-17T16:42:53.000Z","dependencies_parsed_at":"2022-08-23T18:00:55.609Z","dependency_job_id":null,"html_url":"https://github.com/caarlos0-graveyard/zsh-open-pr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caarlos0-graveyard%2Fzsh-open-pr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caarlos0-graveyard%2Fzsh-open-pr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caarlos0-graveyard%2Fzsh-open-pr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caarlos0-graveyard%2Fzsh-open-pr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caarlos0-graveyard","download_url":"https://codeload.github.com/caarlos0-graveyard/zsh-open-pr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247074616,"owners_count":20879282,"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":"2024-08-01T13:01:21.828Z","updated_at":"2025-04-03T20:31:19.695Z","avatar_url":"https://github.com/caarlos0-graveyard.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"open-pr [![Build Status](https://travis-ci.org/caarlos0/zsh-open-pr.svg?branch=master)](https://travis-ci.org/caarlos0/zsh-open-pr)\n==================\n\nOpen pull requests from command line.\n\n![gif showing open-pr in action](/git-open-pr.mov.gif)\n\n## What it does\n\nBasically, when you call `git open-pr`, the function will verify if you are working\non a fork (by convention, you have an `upstream` remote), then, it will open\nyour browser in the correct URL so you can just hit the `Create Pull Request`\nbutton.\n\nThe function also accepts one argument, in case you want to specify another\ntarget branch (instead of master, which is the convention).\n\nURL breakdown:\n\n```\nhttps://github.com/target-remote/repo/compare/master...origin:random-feature\n          |           |            |    |        |   |    |     |\n          |           |            |    |        |   |    |      -\u003e the branch\n          |           |            |    |        |   |    |         you want\n          |           |            |    |        |   |    |         to submit\n          |           |            |    |        |   |    |\n          |           |            |    |        |   |     -\u003e will appear only\n          |           |            |    |        |   |        if you are\n          |           |            |    |        |   |        working in a fork\n          |           |            |    |        |   |\n          |           |            |    |        |    -\u003e default GitHub compare\n          |           |            |    |        |       thing\n          |           |            |    |        |\n          |           |            |    |         -\u003e target branch\n          |           |            |    |\n          |           |            |     -\u003e default GitHub endpoint to open a PR\n          |           |            |\n          |           |             -\u003e the target repository, also from origin\n          |           |                or upstream remotes\n          |           |\n          |            -\u003e can be both origin or upstream\n          |\n           -\u003e default host\n```\n\n## Usage\n\nFor example, when you work on your own project:\n\n```console\n$ git remote -v\norigin  git@github.com:caarlos0/open-pr.git (fetch)\norigin  git@github.com:caarlos0/open-pr.git (push)\n\n$ git branch\n* master\n\n$ git checkout -b random-feature\n$ touch this-file-is-important\n$ git add -A\n$ git commit -m 'did some stuff'\n$ git push\n$ git open-pr\n# will browse https://github.com/caarlos0/open-pr/compare/master...random-feature\n```\n\nWorking on a fork:\n\n```console\n$ git remote -v\norigin  git@github.com:random-user/open-pr.git (fetch)\norigin  git@github.com:random-user/open-pr.git (push)\nupstream  git@github.com:caarlos0/open-pr.git (fetch)\nupstream  git@github.com:caarlos0/open-pr.git (push)\n\n$ git branch\n* master\n\n$ git checkout -b random-feature\n$ touch this-file-is-important\n$ git add -A\n$ git commit -m 'did some stuff'\n$ git push\n$ git open-pr\n# will browse https://github.com/caarlos0/open-pr/compare/master...random-user:random-feature\n```\n\nPrevious example, but to a `develop` branch, for instance:\n\n```console\n$ git open-pr develop\n# will browse https://github.com/caarlos0/open-pr/compare/develop...random-user:random-feature\n```\n\n## Install using [antibody](http://getantibody.github.io/)\n\n```console\n$ antibody bundle caarlos0/open-pr kind:path\n```\n\n## Install using [Fig](https://fig.io)\n\nFig adds apps, shortcuts, and autocomplete to your existing terminal.\n\n\nInstall `zsh-open-pr` in just one click.\n\n\u003ca href=\"https://fig.io/plugins/other/zsh-open-pr_caarlos0-graveyard\" target=\"_blank\"\u003e\u003cimg src=\"https://fig.io/badges/install-with-fig.svg\" /\u003e\u003c/a\u003e\n\n## Usage\n\nJust hit `git open-pr` on your repositories.\n\nYou can also alias it:\n\n```console\n$ git config --global alias.pr open-pr\n$ git pr\n```\n\nBut I like the following approach more:\n\n```console\ngpr() {\n  git push origin HEAD \u0026\u0026 git open-pr \"$@\"\n}\n```\n\nSo I can `git push` and `git open-pr` in a single, three letters command:\n\n```console\n$ gpr\n```\n\n## Contributing\n\nThe project is linted with Shellcheck and have unit tests. Please, take a look\nat them and execute `./build.sh` to make sure it all works well. :beers:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaarlos0-graveyard%2Fzsh-open-pr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaarlos0-graveyard%2Fzsh-open-pr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaarlos0-graveyard%2Fzsh-open-pr/lists"}