git-将分支描述推送到远程 [英] git - pushing branch descriptions to remote
问题描述
每周有一次集成会议,在这里我们会审查未合并到母版中的分支中的代码.首先,我们用它来列出开放的分支机构
Once a week we have integration meetings where we review code in branches not merged in to master. As a starting point we use this to list open branches
git branch -a --no-merged master
我们以机票号码命名我们的分支机构,因此很难看到我们真正在看什么.我回来了
We name our branches after ticket numbers so it tough to see what we are really looking at. I get back
BUG_1231231
BUG_1412434
FEATURE_1231231
FEATURE_1232244
BUG_1231231
BUG_1412434
FEATURE_1231231
FEATURE_1232244
我知道我可以通过运行
添加和查看描述
git branch --edit-description BUG_1231231
git config branch.BUG_1231231
I know I can add and view descriptions by running
git branch --edit-description BUG_1231231
git config branch.BUG_1231231
问题是这些描述似乎存储在本地存储库的配置中.可以将这些描述推送到远程吗?
The issue is these descriptions seemed to be stored in the config of my local repository. Can these descriptions be pushed to the remote?
推荐答案
考虑到描述存储在配置文件中(此处是Git存储库中的本地文件),然后否,分支描述不会被推送.
Considering the description is stored in the config file (here, the local one, within your Git repo), then, no, branch descriptions aren't pushed.
永远不会推送配置文件.请参阅"是否可以克隆远程位置上的git config?"
Config files are not pushed (ever). See "Is it possible to clone git config from remote location?"
不过,简单的文本文件是当时我对分支描述的最初建议.
Simple text files are, though, as my initial answer for branch description recommended at the time.
分支说明都是关于帮助发布有用的消息.
不是为了在不必发布相同信息/提交的其他存储库上复制该消息.
Branch descriptions are all about helping make an helpful message for publishing.
Not for copying that message over the other repos which won't have to publish the same information/commits.
使用
branch.$name.description
作为配置键,为用户提供一个地方来写出分支的用途以及类似的内容,以便使各种子系统(例如:以后可以教"push -s
","request-pull
"和"format-patch --cover-letter
"来使用此信息.
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年后):
Update 2020 (8 years later):
philb 提到 gitgitgadget/git
438 关于分支描述应为可版本化".
philb补充:
philb mentions in the comments the issue gitgitgadget/git
438 about "Branch descriptions should be versionable".
philb adds:
如果已实现,则分支描述将存储在refs中,然后可以推送到远程.
If this is ever implemented, branch descriptions would be stored in refs and could then be pushed to a remote.
这篇关于git-将分支描述推送到远程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!