Giter Site home page Giter Site logo

git-pr's Introduction

git pr

Simple script for git, to locally pull a PR from Github, with an option to not commit changes

Install as a git alias:

Add this to your git config (eg ~/.gitconfig)

[alias]
    pr = "!php /full/path/to/ozh_git_pr.php"

Usage

Assuming you want to locally test PR #1337, just do:

git pr 1337
# or
git pr -n 1337

In detail, this:

  • creates a new branch named pr-1337 and switch to it
  • pulls whatever repo/branch has been submitted as the PR on Github
  • with the -n option, does not commit changes, so you still see what files are modified and what's changed in them

This will be equivalent to :

git checkout -b pr-1337
git pull [--no-commit] https://github.com/SOMEDUDE/SOMEFORK.git SOMEBRANCH

Why a -n switch ? Why would I want to not commit changes ?

With a gigantic pull request that changes a lot of files, it can be easier to review changes, since modified files are marked (if using a tool with icon overlays, like TortoiseGit)

capture2

From now on you can review, of course modify, and then commit changes, or simply git merge --abort if proposed changes are not suitable.

License

Do whatever the hell you want to do with it

git-pr's People

Contributors

ozh avatar tribut avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tribut danivijay

git-pr's Issues

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.