git - 将分支描述推送到远程

标签 git

我们每周召开一次集成 session ,审查未 merge 到 master 的分支中的代码。作为起点,我们使用它来列出打开的分支

git branch -a --no-merged master

我们以票号命名我们的分支机构,因此很难看出我们真正在看什么。我回来了

BUG_1231231
BUG_1412434
FEATURE_1231231
FEATURE_1232244

我知道我可以通过运行
来添加和查看描述 git branch --edit-description BUG_1231231
git config branch.BUG_1231231

问题是这些描述似乎存储在我本地存储库的配置中。这些描述可以推送到远程吗?

最佳答案

考虑到描述存储在配置文件中(这里是本地文件,在您的 Git 存储库中),那么,,不会推送分支描述。

配置文件不会被推送(永远)。参见“Is it possible to clone git config from remote location?

不过,简单的文本文件是 my initial answer for branch description recommended当时。

分支描述都是为了帮助发布有用的信息。
不是为了将该消息复制到其他不需要发布相同信息/提交的 repo 协议(protocol)上。

Using branch.$name.description as the configuration key, give users a place to write about what the purpose of the branch is and things like that, so that various subsystems, e.g. "push -s", "request-pull", and "format-patch --cover-letter", can later be taught to use this information.


2020 年更新(8 年后):

philb提及 in the comments问题gitgitgadget/git 438关于“分支描述应该是可版本化的”。
philb 补充道:

If this is ever implemented, branch descriptions would be stored in refs and could then be pushed to a remote.

关于git - 将分支描述推送到远程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10998142/

相关文章:

c++ - 完全替换功能时是否有可能获得清晰的 git diff?

Git 将 master 分支倒回 master 历史中的特定提交

在 Windows 上使用 PuTTY 的 git push 失败(致命的 : The remote end hung up unexpectedly)

git - 如何在gitignore中指定目录路径

git - git 是否有可能只忽略文件中的特定更改,例如数字?

github pull 请求 : Conflicting advice on commit ranges?

java - 自定义 apache ant 任务 git-add (jgit) 不起作用

git - 无法将主分支从原点 pull 入本地(修改后的) repo

git - 为什么 gh-pages 选项不再可用?

Git Rebase 还是 Squash?