Differences between commit views

You might observe differences in commit history depending on the chosen viewing method.

On GitHub, you can see the commit history of a repository by:

These two commit views may show different information at times. The history for a single file may omit commits found on the repository's commit history.

Git has several different ways of showing the history of a repository. When Git shows the history of a single file, it simplifies history by omitting commits that did not change the file. Instead of looking at every commit to decide whether it touched the file, Git will omit a whole branch if that branch, when merged, did not impact the final contents of the file. Any commits on the branch that touched the file will not be shown.

For a file's commit history, GitHub explicitly follows this simple strategy. It makes the history simpler by removing commits that didn't contribute to the final result. For example, if a side branch made a change and then reverted it, that commit would not show up in the branch history. This makes reviewing branches more efficient, since you only see the commits that affect the file.

This truncated view might not always contain the information you're after. If you want to see the entire history, GitHub provides a view with more information on a repository's commits page.

For more information on how Git considers commit history, see the "History Simplification" section of the git log help article.

Further reading

Did this doc help you?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.