LoginSignup
133
110

More than 5 years have passed since last update.

【git】ブランチ間の差分の取り方

Last updated at Posted at 2017-03-29

ブランチ間の差分を見たい

$ git diff [ブランチ名A] [ブランチ名B]

使用例

$ git diff master develop 

ブランチAの方がBより古い扱いで差分が表示される。

リモートブランチとの比較

$ git diff origin/dvelop fix_routes

リモートブランチのdevelopとローカルのfix_routesを比較する。

更新行数を取得

$ git diff master develop --shortstat
 7 files changed, 502 insertions(+), 1 deletion(-)

オプション"--shortstat"をつけると、ブランチ間の更新行数を比較できる。

133
110
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
133
110