Git command to evenly checkout local/remote branches and source/fork pull requests by URL (with Hub)
Ruby
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
spec
tmp
.gitignore
.rspec
.travis.yml
Gemfile
Guardfile
LICENSE.txt
README.md
Rakefile
git-pcheckout.gemspec
git-pcheckout.gemspec.lock

README.md

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