From 0fde295f5ee1c8edb709e504da47dc8b329c5a08 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Fri, 22 Jan 2016 18:01:28 +0800 Subject: [PATCH] Update git PR manual to mention URLs --- man/git-pr.1 | 30 +++++++++- man/git-pr.html | 143 ------------------------------------------------ man/git-pr.md | 19 ++++++- 3 files changed, 44 insertions(+), 148 deletions(-) diff --git a/man/git-pr.1 b/man/git-pr.1 index 0c62df0..a7df509 100644 --- a/man/git-pr.1 +++ b/man/git-pr.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-PR" "1" "December 2015" "" "" +.TH "GIT\-PR" "1" "January 2016" "" "Git Extras" . .SH "NAME" \fBgit\-pr\fR \- Checks out a pull request locally @@ -10,10 +10,13 @@ \fBgit\-pr\fR [] . .br +\fBgit\-pr\fR +. +.br \fBgit\-pr clean\fR . .SH "DESCRIPTION" -Creates a local branch based on a GitHub pull request number, and switch to that branch afterwards\. +Creates a local branch based on a GitHub pull request number or URL, and switch to that branch afterwards\. . .SH "OPTIONS" @@ -21,6 +24,12 @@ Creates a local branch based on a GitHub pull request number, and switch to that .P The name of the remote to fetch from\. Defaults to \fBorigin\fR\. . +.P + +. +.P +GitHub pull request URL in the format \fBhttps://github\.com/tj/git\-extras/pull/453\fR\. +. .SH "EXAMPLES" This checks out the pull request \fB226\fR from \fBorigin\fR: . @@ -57,6 +66,23 @@ $ git pr 226 upstream .IP "" 0 . .P +You can also checkout a pull request based on a GitHub URL: +. +.IP "" 4 +. +.nf + +$ git pr https://github\.com/tj/git\-extras/pull/453 + +From https://github\.com/tj/git\-extras + * [new ref] refs/pull/453/head \-> pr/453 +Switched to branch \'pr/453\' +. +.fi +. +.IP "" 0 +. +.P To clean up old branches: . .IP "" 4 diff --git a/man/git-pr.html b/man/git-pr.html index 4040613..e69de29 100644 --- a/man/git-pr.html +++ b/man/git-pr.html @@ -1,143 +0,0 @@ - - - - - - git-pr(1) - Checks out a pull request locally - - - - -
- - - -
    -
  1. git-pr(1)
  2. -
  3. -
  4. git-pr(1)
  5. -
- -

NAME

-

- git-pr - Checks out a pull request locally -

- -

SYNOPSIS

- -

git-pr <number> [<remote>]
-git-pr clean

- -

DESCRIPTION

- -

Creates a local branch based on a GitHub pull request number, and switch to - that branch afterwards.

- -

OPTIONS

- -

<remote>

- -

The name of the remote to fetch from. Defaults to origin.

- -

EXAMPLES

- -

This checks out the pull request 226 from origin:

- -
$ git pr 226
-
-remote: Counting objects: 12, done.
-remote: Compressing objects: 100% (9/9), done.
-remote: Total 12 (delta 3), reused 9 (delta 3)
-Unpacking objects: 100% (12/12), done.
-From https://github.com/tj/git-extras
- * [new ref]         refs/pull/226/head -> pr/226
-
-Switched to branch 'pr/226'
-
- -

This pulls from a different remote:

- -
$ git pr 226 upstream
-
- -

To clean up old branches:

- -
$ git pr clean
-
-Deleted branch pr/226 (was b96a8c2).
-Deleted branch pr/220 (was d34dc0f).
-
- -

AUTHOR

- -

Originally from https://gist.github.com/gnarf/5406589

- -

REPORTING BUGS

- -

<https://github.com/tj/git-extras/issues>

- -

SEE ALSO

- -

<https://github.com/tj/git-extras>

- - -
    -
  1. -
  2. December 2015
  3. -
  4. git-pr(1)
  5. -
- -
- - diff --git a/man/git-pr.md b/man/git-pr.md index 9d774ee..93c6fd0 100644 --- a/man/git-pr.md +++ b/man/git-pr.md @@ -4,19 +4,24 @@ git-pr(1) -- Checks out a pull request locally ## SYNOPSIS `git-pr` <number> [<remote>]
+`git-pr` <url>
`git-pr clean` ## DESCRIPTION - Creates a local branch based on a GitHub pull request number, and switch to - that branch afterwards. + Creates a local branch based on a GitHub pull request number or URL, and + switch to that branch afterwards. ## OPTIONS - + <remote> The name of the remote to fetch from. Defaults to `origin`. + <url> + + GitHub pull request URL in the format `https://github.com/tj/git-extras/pull/453`. + ## EXAMPLES This checks out the pull request `226` from `origin`: @@ -36,6 +41,14 @@ This pulls from a different remote: $ git pr 226 upstream +You can also checkout a pull request based on a GitHub URL: + + $ git pr https://github.com/tj/git-extras/pull/453 + + From https://github.com/tj/git-extras + * [new ref] refs/pull/453/head -> pr/453 + Switched to branch 'pr/453' + To clean up old branches: $ git pr clean