在git中分支描述 [英] Branch descriptions in git

查看:273
本文介绍了在git中分支描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让git拥有分支的描述?虽然我尝试使用描述性名称,但在单个分支上工作一段时间有时会减弱我为什么创建其他主题分支的记忆。我尝试为分支使用描述性名称,但我认为'描述'(关于分支目的的简短说明)会很好。

Is there a way in git to have a 'description' for branches? While I try to use descriptive names, working for a while on a single branch sometimes dampens my memory of why I made some of the other topic branches. I try to use descriptive names for the branches but I think a 'description' (short note about the purpose of the branch) would be nice.

推荐答案

Git 1.7.9支持这个。从 1.7.9发行说明: / p>

Git 1.7.9 supports this. From the 1.7.9 release notes:


 * "git branch --edit-description" can be used to add descriptive text
   to explain what a topic branch is about.

您可以在2011年9月看到该功能,其中提交 6f9a332 739453a3 b7200e8

You can see that feature introduced back in September 2011, with commits 6f9a332, 739453a3, b7200e8:

struct branch_desc_cb {
  const char *config_name;
  const char *value;
};

--edit-description::




打开一个编辑器并编辑文本以解释分支的用途,以供各种其他命令使用(例如 request-pull )。

请注意,它不适用于分离的HEAD分支。

Note that it won't work for a detached HEAD branch.

该描述由script request-pull:请参阅提交c016814783 ,但也 git merge --log

That description is used by the script request-pull: see commit c016814783, but also git merge --log.


request-pull 是一个脚本,用于总结两次提交到标准输出之间的变化,并包含给定的URL在生成的摘要中。

request-pull is a script used to summarizes the changes between two commits to the standard output, and includes the given URL in the generated summary.

这篇关于在git中分支描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆