What is a "stale" git branch?

Solution 1:

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 (a local reference 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.


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.


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.

Solution 2:

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.

For more information see https://help.github.com/articles/viewing-branches-in-your-repository/

Solution 3:

That's because there is no "exact definition". "Stale git branch", "stale data", "stale configuration options" -- none of these have an exact definition, but they all refer to things that are considered old/unmaintained/not current/possibly broken.

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.

Solution 4:

Stale branch is a branch without activity after some time. In Github it's stale after 3 months of inactivity.

Reasons, why projects have stale branches: unreleased features, prototype, alternative solution, incomplete, incompatible.

read more