Skip to content

Instantly share code, notes, and snippets.

@lehnerpat
Last active September 3, 2022 04:33

Revisions

  1. lehnerpat revised this gist Sep 7, 2014. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions gh-compare.md
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,6 @@ Naturally, `$USER` and `$REPO` are the owner (user/organization) and repository

    `$REV{A,B}` are the two sides of the compare view; they can either be a *ref* in `$USER`'s repository, i.e. the name of a branch, tag or a commit SHA, or it can be a *ref* in `$OWNER`'s fork of the repository by using the format `$OWNER:$REF`.

    If there is a forward slash (/) in either ref name, you need to replace it by a semicolon (;).

    You can get a diff or patch for the result of the compare view by appending `.diff` or `.patch` to the URL, respectively.

    ---
    @@ -17,5 +15,5 @@ You can get a diff or patch for the result of the compare view by appending `.di
    [`https://github.com/octocat/Spoon-Knife/compare/ed12290ba...master`](https://github.com/octocat/Spoon-Knife/compare/ed12290ba...master)
    *Default usage is pretty straight-forward.*

    `https://github.com/SomeUserName/Spoon-Knife/compare/master...ForkerChamp:topic;awesome-feature`
    *Note that the branchname `topic/awesome-feature` in `ForkerChamp`'s repo turns into `topic;awesome-feature` in the URL.*
    `https://github.com/SomeUserName/Spoon-Knife/compare/master...ForkerChamp:topic/awesome-feature`
    *Branchname is `topic/awesome-feature` in `ForkerChamp`'s repo.*
  2. lehnerpat revised this gist Jun 1, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gh-compare.md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@ GitHub's compare view is available at:

    https://github.com/$USER/$REPO/compare/$REV_A...$REV_B

    Naturally, **`$USER`** and **`$REPO`** are the owner (user/organization) and repository names, respectively.
    Naturally, `$USER` and `$REPO` are the owner (user/organization) and repository names, respectively.

    **`$REV{A,B}`** are the two sides of the compare view; they can either be a *ref* in `$USER`'s repository, i.e. the name of a branch, tag or a commit SHA, or it can be a *ref* in **`$OWNER`**'s fork of the repository by using the format `$OWNER:$REF`.
    `$REV{A,B}` are the two sides of the compare view; they can either be a *ref* in `$USER`'s repository, i.e. the name of a branch, tag or a commit SHA, or it can be a *ref* in `$OWNER`'s fork of the repository by using the format `$OWNER:$REF`.

    If there is a forward slash (/) in either ref name, you need to replace it by a semicolon (;).

    @@ -18,4 +18,4 @@ You can get a diff or patch for the result of the compare view by appending `.di
    *Default usage is pretty straight-forward.*

    `https://github.com/SomeUserName/Spoon-Knife/compare/master...ForkerChamp:topic;awesome-feature`
    Note that the branchname `topic/awesome-feature` in `ForkerChamp`'s repo turns into `topic;awesome-feature` in the URL.
    *Note that the branchname `topic/awesome-feature` in `ForkerChamp`'s repo turns into `topic;awesome-feature` in the URL.*
  3. lehnerpat created this gist Jun 1, 2013.
    21 changes: 21 additions & 0 deletions gh-compare.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    GitHub's compare view is available at:

    https://github.com/$USER/$REPO/compare/$REV_A...$REV_B

    Naturally, **`$USER`** and **`$REPO`** are the owner (user/organization) and repository names, respectively.

    **`$REV{A,B}`** are the two sides of the compare view; they can either be a *ref* in `$USER`'s repository, i.e. the name of a branch, tag or a commit SHA, or it can be a *ref* in **`$OWNER`**'s fork of the repository by using the format `$OWNER:$REF`.

    If there is a forward slash (/) in either ref name, you need to replace it by a semicolon (;).

    You can get a diff or patch for the result of the compare view by appending `.diff` or `.patch` to the URL, respectively.

    ---

    **Examples:**

    [`https://github.com/octocat/Spoon-Knife/compare/ed12290ba...master`](https://github.com/octocat/Spoon-Knife/compare/ed12290ba...master)
    *Default usage is pretty straight-forward.*

    `https://github.com/SomeUserName/Spoon-Knife/compare/master...ForkerChamp:topic;awesome-feature`
    Note that the branchname `topic/awesome-feature` in `ForkerChamp`'s repo turns into `topic;awesome-feature` in the URL.