git rev-parse でできること
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .git ディレクトリ絶対パス表示 | |
git rev-parse --git-dir | |
/path/to/.git | |
# 現在のbranch名表示 | |
git rev-parse --abbrev-ref HEAD | |
# リポジトリがあるか確認 | |
git rev-parse --is-inside-work-tree | |
# リポジトリが共有リポジトリか確認 | |
git rev-parse --is-bare-repository | |
# gitディレクトリのTop表示 | |
git rev-parse --show-toplevel | |
# gitディレクトリとの相対パス表示 | |
git rev-parse --show-cdup |
git rev-parse でできること
https://kenzo0107.github.io/2015/04/16/2015-04-17-git-rev-parse/