Git Product home page Git Product logo

magit-gh-pulls's Introduction

magit-gh-pulls

magit-gh-pulls is a Magit extension that allows you to conveniently manipulate Github’s pull requests from Emacs.

Installation

magit-gh-pulls is available on MELPA. To install it do the following:

M-x package-install RET magit-gh-pulls RET

Now that the package is installed you have to put the following code to your init.el:

(require 'magit-gh-pulls)
(add-hook 'magit-mode-hook 'turn-on-magit-gh-pulls)

Usage

Existing Pull Requests

In magit-status window press # g g to refresh the list of pull requests. magit-gh-pulls automatically infers credentials from the URL of the repository. You can also explicitly specify which Github project to fetch PRs from by executing this in your shell:

git config magit.gh-pulls-repo <user>/<repo> # your github repository

If there are some PRs available, a new section will appear called Pull Requests. Each item in this section has the following form:

[pull-request-number@branch-name] Pull request name

Highlighting the desired PR and pressing # g f will fetch the commits associated with the PR. These are the real commits that you can view, apply, cherry-pick etc.

From this point magit-gh-pulls offers you two options:

  • press # g b on the PR to create a topic branch for this PR. After testing the PR you can merge it back into your branch using Magit.
  • press # g m to merge the PR on top of the currently checked out branch. This is convenient if pull request can be merged by fast-forwarding and no testing is needed (or you can test from your branch directly). A nice benefit of this approach over merging from Github interface is that in case of FF no merge commit is produced, so history stays nice and linear.
Creating Pull Requests

In magit-status press # g c to create a new pull request. You will be asked for the base commit and the head commit for the pull-request. They will default to the default branch of your repository and current head respecively. Enter a title and description for the pull request, and magit-gh-pulls will connect to GitHub to create the pull request. By default, the new pullrequest will be opened on github.com in the browser. You may turn this behavior off by customizing magit-gh-pulls-open-new-pr-in-browser

The base and head of the pull request must already be present on github. If you haven’t yet pushed your local commits, creating the pull request will fail. You can push with magit’s standard P P.

Miscellaneous
  • # g o Will open the selected a pull request in your default browser on GitHub.
  • j q will jump to the Pull Requests section in the magit-status window.

License

Copyright © 2011-2014 Yann Hodique, Alexander Yakushev and contributors. Distributed under the GNU General Public License ver. 2. See the header of the source file.

magit-gh-pulls's People

Contributors

alexander-yakushev avatar areina avatar emoses avatar emosessfdc avatar expez avatar ieure avatar kidd avatar mgalgs avatar sigma avatar swsnr avatar tarsius avatar xendk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.