🔖

【Git】現在のブランチ名を取得する

2023/02/20に公開

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

$ git rev-parse --abbrev-ref HEAD

現在のブランチと指定したブランチの差分を比較する

bash

$ git diff <branch-name> $(git rev-parse --abbrev-ref HEAD)

fish

$ git diff <branch-name> (git rev-parse --abbrev-ref HEAD)

Discussion