What is a "stale" git branch?

GitBranch

Git Problem Overview


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 Solutions


Solution 1 - Git

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 - Git

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 - Git

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 - Git

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncowlinatorView Question on Stackoverflow
Solution 1 - GitVonCView Answer on Stackoverflow
Solution 2 - GitSteelToeView Answer on Stackoverflow
Solution 3 - GitlarsksView Answer on Stackoverflow
Solution 4 - Gitv.babakView Answer on Stackoverflow