如何在一个纯粹的git仓库上运行git描述? [英] Howto run git describe on a bare git respository?
问题描述
我的主机上有一个纯粹的git存储库:
astropanic @ localhost:〜/ production / repo $ ls -1
分支
配置
描述
FETCH_HEAD
HEAD
钩子
信息
对象
打包引用
refs
我可以在这里跑步
<$如果没有将repo复制到非裸(.gb)文件中,p $ p> git describe
git)?
您的git存储库不使用标签。对于 git describe
你需要一个标签。摘自 man
-page:
该命令找到最多最近可以从提交中获得的标签。如果标签
指向提交,则只显示标签。否则,它会将标记
名称加上标记对象顶部的附加提交数量以及最近提交的
缩写对象名称后缀。
默认情况下(没有--all或--tags)git描述只显示带注释的标签。有关创建带注释的标签的更多信息,请参阅-a和-s选项以获得
git-tag
如果在脚本中需要 git describe
,那么在描述中使用 - 总是
选项调用。
- 总是显示缩写的提交对象作为后备
或者使用(带注释的)标签。也许你需要设置capistrano-clients获取标签信息。然后在每个客户端上使用 git fetch --tags
。
I have a bare git repository on my host:
astropanic@localhost:~/production/repo$ ls -1
branches
config
description
FETCH_HEAD
HEAD
hooks
info
objects
packed-refs
refs
How I can run here
git describe
without cloning the repo to non bare (.git) ?
Your git repository doesn't use tags. For git describe
you need a tag. A excerpt from the man
-page:
The command finds the most recent tag that is reachable from a commit. If the tag
points to the commit, then only the tag is shown. Otherwise, it suffixes the tag
name with the number of additional commits on top of the tagged object and the
abbreviated object name of the most recent commit.
By default (without --all or --tags) git describe only shows annotated tags. For
more information about creating annotated tags see the -a and -s options to
git-tag
If you need git describe
in a script than use the --always
option in your describe call.
--always show abbreviated commit object as fallback
Or use (annotated-)tags. Maybe you need to setup that the capistrano-clients fetch the tag informations. Then use git fetch --tags
on every client.
这篇关于如何在一个纯粹的git仓库上运行git描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!