Git command to evenly checkout local/remote branches and source/fork pull requests by URL (with Hub)
Hub is required for checking out pull requests.
$ brew install hub
$ gem install git-pcheckout
$ git pcheckout 123-myfeature
$ git pcheckout https://github.com/user/repo/pull/123
-
If specified branch-name exists locally:
$ git checkout branch-name $ git pull origin branch-name
-
If specified branch-name not exist locally:
$ git fetch $ git checkout --track origin/branch-name
-
If pull request URL specified(from fork):
- pulls fork branch with Hub
- If pull request URL specified(from source repo):
- treats it as if just a branch_name was specified (goto 1)
- Fork it ( http://github.com/vrybas/git-pcheckout/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request