Skip to content

CLI tool to automatically create pull request on Github

Notifications You must be signed in to change notification settings

Idnan/github-pr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Github PR

CLI tool to automatically create pull request on Github

Install

You can install it either using cURL

$ curl -L https://raw.githubusercontent.com/idnan/github-pr/master/installer.sh | sudo sh

Or by cloning and manually installing it

$ git clone https://github.com/idnan/github-pr.git
$ cd github-pr
$ sudo make install

Usage

$ ghpr -t <title> [options]

Below is the description of all the accepted options

  • -h Source branch from which pull request will be created (Default: current branch)
  • -b Target branch to which PR is to be opened (Default: master)
  • -t Title of the PR (Default: the last commit's title, as long as there is only one commit in the PR)
  • -d Description of the PR
  • -c Copy the PR URL to the clipboard
  • -f Fake run, doesn't make the request but prints the URL and body

Examples

Pull request from current branch to master branch with specified title

$ ghpr -t "Adds the unit tests"

Pull request from tests branch to develop

$ ghpr -t "Adds the unit tests" -h develop -b tests

Specifying the description

$ ghpr -t "Adds the unit tests" -h develop -b tests -d "Added unit tests for the ACL module"

Copy the pull request URL to clipboard after opening Will open pull request from current branch to master with the given title and copy the URL to clipboard

$ ghpr -t "Adds the unit tests" -c

Dry run - Below command will not create a pull request but print the meta

$ ghpr -t "Adds the unit tests" -h develop -b tests

Note

You need to have setup the access token on github

$ git config --global auth.token YOUR_ACCESS_TOKEN

License

MIT © Adnan Ahmed

About

CLI tool to automatically create pull request on Github

Resources

Stars

Watchers

Forks

Packages

No packages published