0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Githubの差分比較調べた

Posted at

Githubの差分比較機能について

Github上で任意のcommit間の差分を取る方法について
やろうとする度に忘れて調べてしまってたのでメモ。

  • commit間のdiff
{Githubリポジトリ}/compare/{commit_id}...{commit_id}
  • branch間のdiff ちなみにスラッシュが含まれたブランチ名の場合はそのままURLに反映される
    • feature/hoge
{Githubリポジトリ}/compare/{branch}...{branch}
  • tagもいけます
    • がドットが含まれている場合、URLとして解釈されるので表示できない
    • 大抵タグ名は v1.0等になると思うので基本的には比較できないと思ってたほうが良いかも
{Githubリポジトリ}/compare/{tag}...{branch}
  • 既に例で書いてますが、それぞれの組み合わせでも比較できます

    • commit...branch
    • branch...tag
  • ..... にすると差分のみの表示になる

... だとcommit履歴などの付随情報も表示されますが、..は差分のみの簡易表示になるようです。

へえ~

{Githubリポジトリ}/compare/{branch}..{branch}

以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?