次の抜粋を考えてみましょうgit log --oneline --decorate --graph
:
* 552485a (HEAD -> master, origin/master) Finish v0.8.4
|\
| * c198066 (tag: v0.8.4) some commit message
* | 343af72 Finish v0.8.3
|\ \
| |/
| * 0267e30 (tag: v0.8.3) some commit message
* | 8f0ff57 some commit message
|\ \
| |/
...
(注: タグ v0.8.4 はブランチ 'develop' からのコミットにあります)
実行すると、どうしてgit describe
これが得られるのですか:
v0.8.4-16-g552485a
つまり、git はタグ v0.8.4 以降のコミットを 16 回カウントします。私はそれが戻ってくることを期待していv0.8.4-1-g552485a
ます。
具体的には ( --debug オプションを使用する場合):
suche zur Beschreibung von HEAD
beendete Suche bei b53e85f9c8ee785c0ce50f727819b267107554fd
annotated 16 v0.8.4
annotated 17 v0.8.3
annotated 18 v0.8.2
annotated 22 v0.8
annotated 49 v0.7
annotated 60 v0.6
annotated 85 v0.5
103 Commits durchlaufen
v0.8.4-16-g552485a
興味深いことに、開発ブランチに切り替えると:
0992f78 (HEAD -> develop, origin/develop) Some commit message.
c198066 (tag: v0.8.4) Minor change.
0267e30 (tag: v0.8.3) Minor changes.
git describe
期待どおりに戻ります: v0.8.4-1-g0992f78
背景: SmartGit とその Git-Flow 機能を使用しています。
関連するコミットのグラフィカル ビューを次に示します (赤: マスター、青: 開発):