vrybas / git-pcheckout

Git command to evenly checkout local/remote branches and source/fork pull requests by URL (with Hub)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-pcheckout

Gem Version Code Climate Coverage Build Status

Git command to evenly checkout local/remote branches and source/fork pull requests by URL (with Hub)

Installation

Hub is required for checking out pull requests.

$ brew install hub
$ gem install git-pcheckout

Usage

$ git pcheckout 123-myfeature
$ git pcheckout https://github.com/user/repo/pull/123

What it does

  1. If specified branch-name exists locally:

    $ git checkout branch-name $ git pull origin branch-name

  2. If specified branch-name not exist locally:

    $ git fetch $ git checkout --track origin/branch-name

  3. If pull request URL specified(from fork):

  • pulls fork branch with Hub
  1. If pull request URL specified(from source repo):
  • treats it as if just a branch_name was specified (goto 1)

Contributing

  1. Fork it ( http://github.com/vrybas/git-pcheckout/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Git command to evenly checkout local/remote branches and source/fork pull requests by URL (with Hub)

License:MIT License


Languages

Language:Ruby 100.0%