问题
Short version
When I compare two forks on Github, it does not compare the latest states, but the current state of the base fork with the last common commit (or am I wrong?); so how can I compare the latest states/heads on Github?
Longer version
I am trying to compare two repositories on Github.
It does not seem to compare the latest states of both repository. Instead, it compares:
- the base fork as it was when both repositories where identical (last common commit?)
with
- the head fork as it is now.
You can see this in the Github's fork comparison example, it says there are no changes between those two repositories, but there are now very different.
How can I compare the latest states/heads on Github?
回答1:
https://github.com/github/linguist/compare/master...gjtorikian:master
github:master
is up to date with all commits fromgjtorikian:master
.
Try switching the base for your comparison.
It means that all commits from gjtorikian/liguist are part of github/linguist.
The reverse is not true:
https://github.com/gjtorikian/linguist/compare/master...github:master
That would give all (1866) commits from github/linguist which are not part of gjtorikian/linkguist.
This is triple-dot '...
' diff between the common ancestor of two branches and the second branch (see "What are the differences between double-dot “..” and triple-dot “…” in Git diff commit ranges?"):
In the first case github/linguist:master...gjtorikian/linguist:master
, the common ancestor and gjtorikian/linguist:master
are the same! O commits.
In the second case gjtorikian/linguist:master...github/linguist:master
, github/linguist:master
has 1866 commits since the common ancestor (here, since gjtorikian/linguist:master
).
来源:https://stackoverflow.com/questions/31671585/github-comparing-across-forks