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 (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.