Orphan commits are created when there is no tag or branch that contains them in its graph of parent commits. For example, if you make a branch foo
, add commits a
and b
, then delete the branch (i.e. remove the reference foo
from commit b
), then both a
and b
will not be reachable unless you saved their hashes.
x-x-x-x <- master
\
a-b <- foo (reference then deleted or reset to somewhere on master)
Basic Git behavior on orphaned commits is to eventually garbage collect and delete them (I have heard the default is at least 30 days).
My question is this:
Will Git ever move orphan commits from one repo to another using the git clone
, git fetch
, or git push
commands?
Or does Git effectively ignore these commits for any operation that does not directly call out an orphan's hash (such as checkout
or cherry-pick
)?