什么是“陈旧”的 git 分支?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29112156/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is a "stale" git branch?
提问by cowlinator
A "Stale" git branch is a term I've heard a lot. I know it has something to do with branches which are regarded as less useful or useless, but cannot find an exact definition. What is a "stale" git branch?
“陈旧”的 git 分支是我经常听到的一个术语。我知道它与被认为不太有用或无用的分支有关,但找不到确切的定义。什么是“陈旧”的 git 分支?
采纳答案by VonC
The oldest reference to "stale" is found in commit e194cd1(Jan. 2007, Git 1.5.0), which detected "stale tracking branches in remote": when tracking a branch which was removed by the remote system.
Hence git remote prune
.
在提交 e194cd1(2007 年 1 月,Git 1.5.0)中找到了对“stale”的最旧引用,它检测到“ stale tracking branch in remote”:当跟踪被远程系统删除的分支时。
因此git remote prune
。
That is the main definition for stale branch: a remote tracking branch(a localreference of a remote repo branch) which no longer tracks anything(because the actual branch on the remote repo is gone).
这是陈旧分支的主要定义:远程跟踪分支(远程仓库分支的本地引用)不再跟踪任何内容(因为远程仓库上的实际分支已经消失)。
git remote show
is able to list those.
git remote show
能够列出那些。
Incidentally, you have two other definitions of "stale" in the Git system:
顺便说一下,您在 Git 系统中还有另外两个“陈旧”的定义:
Another reference to "stale" involves
git reflog --stale-fix
in commit 1389d9d(Git 1.5.0), for tracking "broken commit": a commit that is not reachable from any of the refs and there is a missing object among the commit, tree, or blob objects reachable from it that is not reachable from any of the refs.
That helps fixing situation after running non reflog-awaregit prune
from an older git in the presence of reflogs.Commit 740fdd2(March 2008, Git 1.5.5) also introduces "stale" for symbolic refs, when the ref they point to no longer exists.
到“陈旧”另一个参考涉及
git reflog --stale-fix
在提交1389d9d(GIT 1.5.0),用于跟踪“破提交”:提交不是从任何裁判的可达并且在提交,树,或斑点的对象中一个缺少对象可以从它到达,而不能从任何 refs 到达。
这有助于解决git prune
在存在引用日志的情况下从较旧的 git运行非引用日志感知的情况。Commit 740fdd2(2008 年 3 月,Git 1.5.5)还为符号 refs引入了“陈旧” ,当它们指向的 ref 不再存在时。
As mentioned by @SteelToe:
The definition of a stale branch, as per GitHub documentation, is a branch that has not had any commits in the previous 3 months.
This generally indicates an old/unmaintained/not current branch.
正如@SteelToe 所提到的:根据GitHub 文档,陈旧分支的定义是在过去 3 个月内没有任何提交的分支。
这通常表示旧的/未维护的/非当前分支。
回答by SteelToe
The definition of a stale branch, as per GitHub documentation, is a branch that has not had any commits in the previous 3 months.
根据 GitHub 文档,陈旧分支的定义是在过去 3 个月内没有任何提交的分支。
This generally indicates an old/unmaintained/not current branch.
这通常表示旧的/未维护的/非当前分支。
For more information see https://help.github.com/articles/viewing-branches-in-your-repository/
有关更多信息,请参阅https://help.github.com/articles/viewing-branches-in-your-repository/
回答by larsks
That's because there is no "exact definition". "Stale git branch", "stale data", "stale configuration options" -- none of these have an exactdefinition, but they all refer to things that are considered old/unmaintained/not current/possibly broken.
那是因为没有“确切的定义”。“陈旧的 git 分支”、“陈旧的数据”、“陈旧的配置选项”——这些都没有一个确切的定义,但它们都指的是被认为是旧的/未维护的/不是最新的/可能损坏的东西。
So a "stale git branch" is generally a branch of the repository that hasn't been touched in a long time. Maybe it's broken, maybe not; it's certainly not current w/r/t to the active development branch, and nobody has looked at it for a while.
因此,“陈旧的 git 分支”通常是存储库中很长时间没有被触及的分支。也许它坏了,也许没有;它肯定不是当前活跃的开发分支的 w/r/t,并且已经有一段时间没有人看过它了。
回答by v.babak
Stale branchis a branch without activity after some time. In Github it's stale after 3 months of inactivity.
陈旧分支是一段时间后没有活动的分支。在 Github 中,它在闲置 3 个月后就陈旧了。
Reasons, why projects have stale branches: unreleased features, prototype, alternative solution, incomplete, incompatible.
项目具有陈旧分支的原因:未发布的功能、原型、替代解决方案、不完整、不兼容。