Skip to content

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

License

Notifications You must be signed in to change notification settings

vrybas/git-pcheckout

Repository files navigation

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)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages