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?

git branch間の差分比較

0
Posted at

ブランチの確認

# ローカルブランチの一覧を表示一覧表示
git branch 
# 出力例
  dev
* main
# *が付いているブランチが現在チェックアウトされているブランチ。
# リモート追跡ブランチなどの情報も表示する場合:
git branch -a

ブランチ間の差分比較

git diffを使う。

# ブランチ間の差分比較 
git diff dev..main
# どのファイルが何行変更があるか。 
git diff --stat dev..main

...と..では動作が異なる。

git diff main...dev
# は、分岐点からdevまでの変更を表示する。
#「分岐以降にブランチで何を変更したか」の確認にはこちらが適しているといえる。
git diff main..dev
# は、現在のmain先端とdev先端の内容を直接比較する。

特定ファイルだけ比較する場合:

# src/hoge.f90だけを比較。
git diff dev..main -- src/hoge.f90
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?