开发者

Where does Git store tags?

Where does Git store tags? I execute:

$ git tag
v0.1.0
v0.10.0
v0.11.0

But the directory .git/refs/tags is empty. Where does Git store these tags?

Thank you开发者_JS百科.


They can also be stored in .git/packed-refs


While wnoise is correct when he stated that Git also stores tags in .git/packed-refs following a git gc operation, between "pack" points (meaning, between git gc operations), Git creates unpacked commit objects and unpacked tags:

derek@derek-OptiPlex-960:~/Projects/test$ git tag
1
2
3
derek@derek-OptiPlex-960:~/Projects/test$ cat .git/packed-refs 
# pack-refs with: peeled 
55a87ab06897aca29285e58beb4e0de15af409fa refs/heads/master
89a6b171ee6d56bc3ce5a4cbd92c6a379594d974 refs/tags/1
55a87ab06897aca29285e58beb4e0de15af409fa refs/tags/2
derek@derek-OptiPlex-960:~/Projects/test$ ls .git/refs/tags
3
derek@derek-OptiPlex-960:~/Projects/test$
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜