LoginSignup
109
87

More than 5 years have passed since last update.

現在のブランチ名を取得するコマンド

Posted at

以下のコマンドで、現在のブランチ名を表示できる。

git branch --contains=HEAD

branch コマンドの contains オプションは、指定したコミットを含むブランチのみを表示する。

コミット指定を省略すると HEAD が指定されたとみなすので、以下でも上記コマンドと同じ意味になる。

git branch --contains
109
87
4

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
109
87