什么是“陈旧” git分支? [英] What is a "stale" git branch?

查看:1735
本文介绍了什么是“陈旧” git分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git分支是我听过很多的术语。我知道这与那些被认为没用或无用的分支有关,但找不到确切的定义。什么是陈旧的git分支?

解决方案

stale的最旧引用可在 commit e194cd1 (2007年1月,Git 1.5.0),它检测到 / strong>:跟踪远程系统删除的分支。

因此 git remote prune



这是stale分支的主要定义:远程跟踪不跟踪任何东西的分支(因为远程回购的实际分支已经消失)
$ b $ p $ git远程显示可以列出它们。






顺便提一下,Git系统中有两个其他的stale定义:




  • 对stale的另一个引用涉及 git reflog --stale-fix commit 1389d9d (Git 1.5.0),用于跟踪破坏的提交:提交不是可以从任何ref获得,并且从其可到达的提交,树或Blob对象中有一个缺失的对象,这些对象无法从任何
    引用中获得。

    这有助于修复运行非reflog感知的 git prune 从旧的git中存在reflogs。

  • Commit 740fdd2 (2008年3月,Git 1.5.5)也为符号引用引入了过时,当它们指向的引用不再存在时。


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?

解决方案

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.

That is the main definition for stale branch: a remote tracking branch which doesn't track anything (because the actual branch on the remote repo is gone)

git remote show is able to list those.


Incidentally, you have two other definitions of "stale" in the Git system:

  • 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-aware git 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分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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