在我們的存儲庫上運行git describe --tags
時,它不再報告其中一個分支上的最新標記,即使看起來提交在兩個分支中。git describe --tags不報告正確的標記
有沒有人有任何想法如何發生這種情況,以及我如何能夠解決它,使標籤也可以在開發分支?
$ git tag
...
2.7.1
2.7.2
2.7.3
2.7.4
$ git checkout develop
$ git describe --tags --abbrev=0
2.7.2
$ git rev-list -n 1 2.7.4
d700ec90cd7a82be076c1b69b0815a3dab4597ac
$ git rev-list -n 1 2.7.2
79c161b96541da2d039e0cef649044f57387fa8d
$ git cat-file -t 2.7.2
commit
$ git cat-file -t 2.7.4
commit
$ git merge master
Already up-to-date.
$ git branch --contains d700ec90cd7a82be076c1b69b0815a3dab4597ac
* develop
master
$ git describe --tags --abbrev=0
2.7.2
$ git log 2.7.4..HEAD
# shows the proper log even on develop (where the tag doesn't exist according to describe)
$ git checkout master
$ git describe --tags --abbrev=0
2.7.4
從開發分支:
$ git describe --tags --abbrev=0 --debug
searching to describe HEAD
lightweight 580 2.7.2
lightweight 613 2.7.1
lightweight 618 2.7.0
lightweight 791 2.6.0
lightweight 1134 2.5.2
lightweight 1210 2.5.1
lightweight 1345 2.5.0
lightweight 1464 2.4.4
lightweight 1597 2.7.4
lightweight 1597 2.7.3
traversed 1600 commits
more than 10 tags found; listed 10 most recent
gave up search at f3a739ef25d49556538e990c110df3f465e29fa3
2.7.2
從主分支:
$ git describe --tags --abbrev=0 --debug
2.7.4
從開發分支(部分):
$ git log --graph --decorate --oneline --all --simplify-by-decoration
* c813804fd (HEAD -> develop, origin/develop, origin/HEAD) Merge pull request #3070
* d700ec90c (tag: 2.7.4, origin/master, master) Bump version: 2.7.3 → 2.7.4
* ce8e6b8a9 (tag: 2.7.3) Bump version: 2.7.2 → 2.7.3
* 79c161b96 (tag: 2.7.2) Bump version: 2.7.1 → 2.7.2
* 17aa75b5a (tag: 2.7.1) Bump version: 2.7.0 → 2.7.1
* e4b0d4c7e (tag: 2.7.0) Bump version: 2.6.0 → 2.7.0
你可以顯示'git describe --tags --abrev = 0 --debug'嗎? –
@AnonySottile更新爲包含該輸出。 – hatch