LoginSignup
56

More than 5 years have passed since last update.

gitでローカルのブランチが追跡しているリモートブランチを確認する方法

Posted at

gitでローカルのブランチが追跡しているリモートブランチの確認する方法がわからなくて調べたのでメモ。

下記コマンドで調べられる。

$ git branch -vv

結果として以下のような情報が得られる。

ブランチ名 コミット番号 [追跡ブランチ名] コミットメッセージ

ちなみに、追跡するリモートブランチを設定する際は

$ git branch --set-upstream-to=origin/[ブランチ名]

# 省略形
$ git branch -u origin/[ブランチ名]

もしくは

git push -u origin [ブランチ名]

参考にさせていただいたサイト様
http://dackdive.hateblo.jp/entry/2014/02/02/235439

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
56