どのようにしてリモート起点ブランチのすべての名前を取得できますか?特定のリモートのブランチ名のリスト
私は--remote --list
オプションから開始しましたが、冗長origin/HEAD -> origin/master
メッセージと別の起点からの分岐を得ました。特定の起源の
$> git branch --remote --list
origin/HEAD -> origin/master
origin1/develop
origin1/feature/1
origin1/feature/2
origin1/feature/3
origin1/master
origin2/develop
origin2/feature/1
origin2/feature/2
origin2/master
支店は<pattern>
オプションと一致することができますが、冗長なメッセージはまだそこにあります。実際にそのパターンは実際には正しくありません。なぜなら、ある起源の名前は、別の起点名の一部、あるいはいくつかの支店の部分文字列である可能性があるからです。私が探しています何
$> git branch --remote --list origin1*
origin1/HEAD -> origin/master
origin1/develop
origin1/feature/1
origin1/feature/2
origin1/feature/3
origin1/master
がorigin1
の支店名のリストである、それらのいずれかは、私がgit checkout
コマンドのために使用することができます。そのような何か:
develop
feature/1
feature/2
feature/3
master
それはそれがために彼らのunsafenessとバリエーションの、唯一の真のgit
パワーで、grep
、sed
、tail
あるいはghc -e
ラッパーなしで行われるべきであることが重要です。
網羅的な答えをありがとう。 –
私もこれに答えることができましたが、 "sed"ルールはどうなったのですか? lol、whatever – KurzedMetal
@KurzedMetal trueですが、 'git branch'のような磁器コマンドではなく、配管コマンドだけを使って' sed'の使用を慎重に正当化しました。たとえば、http://stackoverflow.com/questions/2978947/how-to-list-all-the-log-for-current-project-in-git/2979124#2979124またはhttp://stackoverflow.com/questionsを参照してください。/2976665/git-changelog-day-day/2976776#2976776 – VonC