git - Find the branch of a commit on github -
i want find out branches commit belongs on github unlike of commits, 1 not display branch on github
a) b) cloned repository, and ran git branch --contains <commitid>
locally, got error: no such commit
however, on github can navigate commit passing <commitid>
in url think contradict error got earlier...
i suspect branch deleted (i not sure remote branch deletion, think ref
removed , commits left untouched?)...and commit not reachable (ignored when git clone
locally?)
if how can find more information these "zombie commits"? if wrong, happened? maybe git revert
?
a pull request not branch, marker says "i want merge feature branch other branch".
what has happened here is:
- someone created branch.
- a pull request created merge branch.
- the branch merged without use of
--no-ff
, , deleted. - then cloned.
since commits now-deleted branch unreachable, git doesn't bother send them when clone. since haven't yet been garbage collected on remote, can still see them when navigate using url on github (an operation equivalent git show <somehash>
).
use of merge commit (such via --no-ff
) prevent "original" commit becoming unreachable when merge. rebase-then-merge leads hashes changing, no merge commits - people don't clutter merge commits.
you find history of branch got merged contains identical commit different hash. not believe there way "clone-with-junk" that'd include commit. git commit --mirror
closest, gets refs....
Comments
Post a Comment