How do you annotate a branch?

后端 未结 7 1227
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 02:34

Is there any way to annotate a branch? It would be nice to be able to do something like:

$ git notes add branch-name -m \'This branch is for whatever\'
<
7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-08 02:51

    Using git tag --annotate tags with descriptions may be created.

    The tag is technically attributed to a commit instead of a branch. If all collaborators agree on using the branch name (as part of) the tag name, the corresponding tag(s) to a branch can be listed using the branch name as part of a filter pattern. The -n option allows to show the actual annotation. Aliases may come handy in order to automatically use the current branch name for creating and listing special branch description tags.

    Note 1: git describe may be used to find the most recent tag in a branch. Unfortunately this may list tags of other branches if they are merged into the branch of interest.

    Note 2: It is not recommended to update a tag to HEAD manually using --force.

    An advantage of using tags is that the description is available to all collaborators.

提交回复
热议问题